summaryrefslogtreecommitdiff
path: root/src/passes/StackCheck.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Remove old stack function from StackCheck (#3100)Alon Zakai2020-09-031-12/+1
|
* StackCheck: Check both under and overflow (#3091)Alon Zakai2020-09-021-24/+53
| | | | | | | | | | | | | | | | | | | See emscripten-core/emscripten#9039 (comment) The valid stack area is a region [A, B] in memory. Previously we just checked that new stack positions S were S >= A, which prevented us from growing too much (the stack grows down). But that only worked if the growth was small enough to not overflow and become a big unsigned value. This PR makes us check the other way too, which requires us to know where the stack starts out at. This still supports the old way of just passing in the growth limit. We can remove it after the roll. In principle this can all be done on the LLVM side too after emscripten-core/emscripten#12057 but I'm not sure of the details there, and this is easy to fix here and get testing up (which can help with later LLVM work). This helps emscripten-core/emscripten#11860 by allowing us to clean up some fastcomp-specific stuff in tests.
* Move stack-check into its own pass (#2994)Sam Clegg2020-07-271-0/+157
This new pass takes an optional stack-check-handler argument which is the name of the function to call on stack overflow. If no argument is passed then it just traps.