mirror of
https://github.com/roc-lang/roc.git
synced 2025-12-23 08:48:03 +00:00
When handling low-level lambdas (like Str.is_eq), the code was decrefing arguments with borrow semantics, but the defer statements at the top of these functions already handle decrefing. This caused a double-free when comparing heap-allocated strings (24+ characters). The fix removes the explicit decrefs in the low-level lambda paths since the defer statements already handle cleanup.
18 lines
357 B
Text
18 lines
357 B
Text
app [main!] { pf: platform "./platform/main.roc" }
|
|
|
|
import pf.Stdin
|
|
import pf.Stdout
|
|
|
|
main! = || {
|
|
# Read lines until empty string
|
|
var $count = 0
|
|
var $continue = True
|
|
while $continue {
|
|
line = Stdin.line!()
|
|
Stdout.line!(line)
|
|
$count = $count + 1
|
|
if line == "" {
|
|
$continue = False
|
|
}
|
|
}
|
|
}
|