summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ir/properties.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/ir/properties.h b/src/ir/properties.h
index 1331eeb73..b86032ba0 100644
--- a/src/ir/properties.h
+++ b/src/ir/properties.h
@@ -132,6 +132,10 @@ inline Literals getLiterals(const Expression* curr) {
// Check if an expression is a sign-extend, and if so, returns the value
// that is extended, otherwise nullptr
inline Expression* getSignExtValue(Expression* curr) {
+ // We only care about i32s here, and ignore i64s, unreachables, etc.
+ if (curr->type != Type::i32) {
+ return nullptr;
+ }
using namespace Match;
int32_t leftShift = 0, rightShift = 0;
Expression* extended = nullptr;
@@ -184,6 +188,10 @@ inline Index getAlmostSignExtBits(Expression* curr, Index& extraLeftShifts) {
// Check if an expression is a zero-extend, and if so, returns the value
// that is extended, otherwise nullptr
inline Expression* getZeroExtValue(Expression* curr) {
+ // We only care about i32s here, and ignore i64s, unreachables, etc.
+ if (curr->type != Type::i32) {
+ return nullptr;
+ }
using namespace Match;
int32_t mask = 0;
Expression* extended = nullptr;