aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorHeejin Ahn <aheejin@gmail.com>2024-03-27 11:11:16 -0700
committerGitHub <noreply@github.com>2024-03-27 11:11:16 -0700
commit52431fdb1ab8d29be078edd55250e06381e4b6b0 (patch)
tree62a4228737aa16e0a53d6f3ccbd8c2c760564944 /clang/lib/CodeGen/CodeGenModule.cpp
parent5a7341a7ae29be80be944b73419eba4017826cd1 (diff)
downloadllvm-52431fdb1ab8d29be078edd55250e06381e4b6b0.zip
llvm-52431fdb1ab8d29be078edd55250e06381e4b6b0.tar.gz
llvm-52431fdb1ab8d29be078edd55250e06381e4b6b0.tar.bz2
[WebAssembly] Remove threwValue comparison after __wasm_setjmp_test (#86633)
Currently the code thinks a `longjmp` occurred if both `__THREW__` and `__threwValue` are nonzero. But `__threwValue` can be 0, and the `longjmp` library function should change it to 1 in case it is 0: https://en.cppreference.com/w/c/program/longjmp Emscripten libraries were not consistent about that, but after https://github.com/emscripten-core/emscripten/pull/21493 and https://github.com/emscripten-core/emscripten/pull/21502, we correctly pass 1 in case the input is 0. So there will be no case `__threwValue` is 0. And regardless of what `longjmp` library function does, treating `longjmp`'s 0 input to its second argument as "not longjmping" doesn't seem right. I'm not sure where that `__threwValue` checking came from, but probably I was porting then fastcomp's implementation and moved this part just verbatim: https://github.com/emscripten-core/emscripten-fastcomp/blob/9bdc7bb4fc595fe05a021b06fe350e8494a741a1/lib/Target/JSBackend/CallHandlers.h#L274-L278 Just for the context, how this was discovered: https://github.com/emscripten-core/emscripten/pull/21502#pullrequestreview-1942160300
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
0 files changed, 0 insertions, 0 deletions