summaryrefslogtreecommitdiff
path: root/test/lld/basic_safe_stack.wat.out
diff options
context:
space:
mode:
Diffstat (limited to 'test/lld/basic_safe_stack.wat.out')
-rw-r--r--test/lld/basic_safe_stack.wat.out50
1 files changed, 37 insertions, 13 deletions
diff --git a/test/lld/basic_safe_stack.wat.out b/test/lld/basic_safe_stack.wat.out
index a72f3d215..9e6a916da 100644
--- a/test/lld/basic_safe_stack.wat.out
+++ b/test/lld/basic_safe_stack.wat.out
@@ -2,11 +2,13 @@
(type $none_=>_none (func))
(type $i32_=>_none (func (param i32)))
(type $i32_=>_i32 (func (param i32) (result i32)))
+ (type $i32_i32_=>_none (func (param i32 i32)))
(import "env" "__handle_stack_overflow" (func $__handle_stack_overflow))
(memory $0 2)
(table $0 1 1 funcref)
(global $global$0 (mut i32) (i32.const 66112))
(global $global$1 i32 (i32.const 568))
+ (global $__stack_base (mut i32) (i32.const 0))
(global $__stack_limit (mut i32) (i32.const 0))
(export "memory" (memory $0))
(export "__wasm_call_ctors" (func $__wasm_call_ctors))
@@ -15,6 +17,7 @@
(export "main" (func $main))
(export "__data_end" (global $global$1))
(export "__set_stack_limit" (func $__set_stack_limit))
+ (export "__set_stack_limits" (func $__set_stack_limits))
(export "__growWasmMemory" (func $__growWasmMemory))
(func $__wasm_call_ctors
(nop)
@@ -22,11 +25,17 @@
(func $stackRestore (param $0 i32)
(local $1 i32)
(if
- (i32.lt_u
- (local.tee $1
- (local.get $0)
+ (i32.or
+ (i32.gt_u
+ (local.tee $1
+ (local.get $0)
+ )
+ (global.get $__stack_base)
+ )
+ (i32.lt_u
+ (local.get $1)
+ (global.get $__stack_limit)
)
- (global.get $__stack_limit)
)
(call $__handle_stack_overflow)
)
@@ -40,19 +49,25 @@
(local $3 i32)
(block
(if
- (i32.lt_u
- (local.tee $3
- (local.tee $1
- (i32.and
- (i32.sub
- (global.get $global$0)
- (local.get $0)
+ (i32.or
+ (i32.gt_u
+ (local.tee $3
+ (local.tee $1
+ (i32.and
+ (i32.sub
+ (global.get $global$0)
+ (local.get $0)
+ )
+ (i32.const -16)
)
- (i32.const -16)
)
)
+ (global.get $__stack_base)
+ )
+ (i32.lt_u
+ (local.get $3)
+ (global.get $__stack_limit)
)
- (global.get $__stack_limit)
)
(call $__handle_stack_overflow)
)
@@ -70,6 +85,14 @@
(local.get $0)
)
)
+ (func $__set_stack_limits (param $0 i32) (param $1 i32)
+ (global.set $__stack_base
+ (local.get $0)
+ )
+ (global.set $__stack_limit
+ (local.get $1)
+ )
+ )
(func $__growWasmMemory (param $newSize i32) (result i32)
(memory.grow
(local.get $newSize)
@@ -95,6 +118,7 @@
"stackAlloc",
"main",
"__set_stack_limit",
+ "__set_stack_limits",
"__growWasmMemory"
],
"namedGlobals": {