diff options
author | Thomas Lively <tlively@google.com> | 2020-07-03 17:15:39 -0700 |
---|---|---|
committer | Thomas Lively <tlively@google.com> | 2020-07-03 17:15:39 -0700 |
commit | 8df30d988e9e595fa9883706198aec23b2e6d227 (patch) | |
tree | 6055031aaf44f8fdc475e701b6918f6634dff219 /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | 1c6e2eceeb1fe9faa9f7e95424e2a7f1b1d0fb9a (diff) | |
download | llvm-8df30d988e9e595fa9883706198aec23b2e6d227.zip llvm-8df30d988e9e595fa9883706198aec23b2e6d227.tar.gz llvm-8df30d988e9e595fa9883706198aec23b2e6d227.tar.bz2 |
[WebAssembly] Do not omit range checks for i64 switches
Summary:
Since the br_table instruction takes an i32, switches over i64s (and
larger integers) must use the i32.wrap_i64 instruction to truncate the
table index. This truncation makes numbers just over 2^32
indistinguishable from small numbers, so it was a miscompilation to
omit the range check preceding these br_tables. This change fixes the
problem by skipping the "fixing" of the br_table when the range check
is an i64 instruction.
Fixes PR46447.
Reviewers: aheejin, dschuff, kripken
Reviewed By: kripken
Subscribers: sbc100, jgravelle-google, hiraditya, sunfish, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D83017
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions