mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-11-27 15:41:46 +00:00
[WebAssembly] Fix bug where -no-type-check failed to completely disable the typechecker
Related to <https://github.com/llvm/llvm-project/issues/55566>. Committing directly (per LLVM's code review policy) as this is a trivial fix.
This commit is contained in:
parent
3948962b45
commit
4e8b2ac7c0
@ -1103,7 +1103,8 @@ public:
|
||||
}
|
||||
|
||||
void onEndOfFunction(SMLoc ErrorLoc) {
|
||||
TC.endOfFunction(ErrorLoc);
|
||||
if (!SkipTypeCheck)
|
||||
TC.endOfFunction(ErrorLoc);
|
||||
// Reset the type checker state.
|
||||
TC.Clear();
|
||||
|
||||
|
13
llvm/test/MC/WebAssembly/type-checker-disabled.s
Normal file
13
llvm/test/MC/WebAssembly/type-checker-disabled.s
Normal file
@ -0,0 +1,13 @@
|
||||
# RUN: llvm-mc -triple=wasm32 -no-type-check %s 2>&1
|
||||
|
||||
# Check no errors are produced when type checking is disabled.
|
||||
|
||||
correctly_typed:
|
||||
.functype correctly_typed () -> (i32)
|
||||
i32.const 1
|
||||
end_function
|
||||
|
||||
incorrectly_typed:
|
||||
.functype incorrectly_typed () -> (i32)
|
||||
nop
|
||||
end_function
|
Loading…
Reference in New Issue
Block a user