This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] Do not assume br_table range checks will be gt_u
ClosedPublic

Authored by tlively on Jul 4 2020, 6:07 PM.

Details

Summary

OSS-Fuzz and the Emscripten test suite uncovered some edge cases in
which the range check instruction seemed to be an (i32.const 0) or
other unexpected instruction, triggering an assertion. Unfortunately
the reproducers are rather complicated, so they don't make good unit
tests. This commit removes the bad assertion and conservatively
optimizes range checks only when the range check instruction is
i32.gt_u.

Diff Detail

Event Timeline

tlively created this revision.Jul 4 2020, 6:07 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 4 2020, 6:07 PM

Landing TBR to unbreak stuff faster.

This revision was not accepted when it landed; it landed in state Needs Review.Jul 4 2020, 6:23 PM
This revision was automatically updated to reflect the committed changes.