-
Notifications
You must be signed in to change notification settings - Fork 654
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Unreachable" exception not thrown correctly on llvm-jit mode #2646
Comments
Hi, thanks for reporting the issue! I submitted patch set for PR #2697 to fix, could you please apply it, re-compile wamrc and test again? |
I tested it with |
It is related to change in aot_emit_control.c, invalid llvm phi value may be used into the else basic block (use %and53 = and i32 %or, %and52
br label %if0_else
if0_else: ; preds = %func_begin
%else0_phi0 = phi i32 [ %"local0#", %func_begin ]
%else0_phi1 = phi i32 [ %add, %func_begin ]
call void @"aot_func#41"(ptr %exec_env, i32 %if0_phi0, i32 %if0_phi1) => should use %else0_phi0 and %else0_phi1 but not %if0_phi0 and %if0_phi1
br label %if0_end |
What is |
BLOCK/LOOP block0_begin/loop0_begin: (llvm_entry_block)
... => ...
END block0_end/loop0_end: (llvm_end_block) IF if0_begin: (llvm_entry_block)
... ...
ELSE => if0_else: (llvm_else_block)
... ...
END if0_end: (llvm_end_block) |
Test Case
code.zip
Result
fast-jit
mode can throwunreachable
exception correctly whilellvm-jit
will throw asegmentation fault
I also ran the same code on other wasm runtimes. They all can report
unreachable
exception correctly.Versions and Environment
wamr version : 1.2.3
Operating system: Ubuntu 20.04
Architecture: x86_64
The text was updated successfully, but these errors were encountered: