From b2d4a1811c7ea9f44720bb0e5aba4f64a7f73e58 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Tue, 13 Oct 2020 18:53:42 -0700 Subject: PickLoadSigns fuzz fix: cannot make an atomic operation signed (#3235) --- src/passes/PickLoadSigns.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/passes/PickLoadSigns.cpp b/src/passes/PickLoadSigns.cpp index c3b5a2ba2..3541b1055 100644 --- a/src/passes/PickLoadSigns.cpp +++ b/src/passes/PickLoadSigns.cpp @@ -109,6 +109,10 @@ struct PickLoadSigns : public WalkerPass> { load->bytes * 8)) { // unsigned usages exist but the wrong size continue; } + // Atomic operations are always unsigned, never signed. + if (load->isAtomic) { + continue; + } // we can pick the optimal one. our hope is to remove 2 items per // signed use (two shifts), so we factor that in load->signed_ = usage.signedUsages * 2 >= usage.unsignedUsages; -- cgit v1.2.3