Skip to content

Commit 03d535d

Browse files
committed
fix(wasip2): avoid double initialization in run
Signed-off-by: Roman Volosatovs <[email protected]>
1 parent 086327b commit 03d535d

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

src/runtime/runtime_wasm_wasip2.go

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,6 @@ import (
1111

1212
type timeUnit int64
1313

14-
//export wasi:cli/[email protected]#run
15-
func __wasi_cli_run_run() uint32 {
16-
// These need to be initialized early so that the heap can be initialized.
17-
heapStart = uintptr(unsafe.Pointer(&heapStartSymbol))
18-
heapEnd = uintptr(wasm_memory_size(0) * wasmPageSize)
19-
run()
20-
return 0
21-
}
22-
2314
//export _initialize
2415
func _initialize() {
2516
// These need to be initialized early so that the heap can be initialized.
@@ -29,6 +20,12 @@ func _initialize() {
2920
initAll()
3021
}
3122

23+
//export wasi:cli/[email protected]#run
24+
func __wasi_cli_run_run() uint32 {
25+
callMain()
26+
return 0
27+
}
28+
3229
var args []string
3330

3431
//go:linkname os_runtime_args os.runtime_args

0 commit comments

Comments
 (0)