binaryen icon indicating copy to clipboard operation
binaryen copied to clipboard

Change stack pass to use existing global variables.

Open eyebrowsoffire opened this issue 3 years ago • 0 comments

This partially fixes https://github.com/emscripten-core/emscripten/issues/16496

With this change, toolchains can specify __stack_base and __stack_end global variables which the binaryen stack pass uses directly to check against overflows, instead of the pass emitting its own variables and setter (which previously was __set_stack_limits, and toolchains had to invoke this setter).

If the globals are not declared, the stack pass errors out.

I am leaving __set_stack_limits in as a no-op in order to not break emscripten. Once emscripten gets rid of its invocations of __set_stack_limits I can follow up and remove that function completely.

eyebrowsoffire avatar Jul 29 '22 20:07 eyebrowsoffire