summaryrefslogtreecommitdiff
path: root/src/ast/properties.h
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2017-07-18 09:17:57 -0700
committerGitHub <noreply@github.com>2017-07-18 09:17:57 -0700
commite865f2fa2863b6e91521c059a61a4483769bf5c9 (patch)
treef2d4bbee701376a4975ebf0d2c518f10369fdabd /src/ast/properties.h
parent24accd15fb59d476daaebbbcd492b8a9ee729b2b (diff)
parent7bc2ed70de137aa6615fcd5d0e1f3e88f008a738 (diff)
downloadbinaryen-e865f2fa2863b6e91521c059a61a4483769bf5c9.tar.gz
binaryen-e865f2fa2863b6e91521c059a61a4483769bf5c9.tar.bz2
binaryen-e865f2fa2863b6e91521c059a61a4483769bf5c9.zip
Merge pull request #1095 from WebAssembly/fuzz-3
More fuzz fixes
Diffstat (limited to 'src/ast/properties.h')
-rw-r--r--src/ast/properties.h24
1 files changed, 14 insertions, 10 deletions
diff --git a/src/ast/properties.h b/src/ast/properties.h
index 9121deba5..097f7a8f0 100644
--- a/src/ast/properties.h
+++ b/src/ast/properties.h
@@ -60,11 +60,13 @@ struct Properties {
if (auto* outer = curr->dynCast<Binary>()) {
if (outer->op == ShrSInt32) {
if (auto* outerConst = outer->right->dynCast<Const>()) {
- if (auto* inner = outer->left->dynCast<Binary>()) {
- if (inner->op == ShlInt32) {
- if (auto* innerConst = inner->right->dynCast<Const>()) {
- if (outerConst->value == innerConst->value) {
- return inner->left;
+ if (outerConst->value.geti32() != 0) {
+ if (auto* inner = outer->left->dynCast<Binary>()) {
+ if (inner->op == ShlInt32) {
+ if (auto* innerConst = inner->right->dynCast<Const>()) {
+ if (outerConst->value == innerConst->value) {
+ return inner->left;
+ }
}
}
}
@@ -87,11 +89,13 @@ struct Properties {
if (auto* outer = curr->dynCast<Binary>()) {
if (outer->op == ShrSInt32) {
if (auto* outerConst = outer->right->dynCast<Const>()) {
- if (auto* inner = outer->left->dynCast<Binary>()) {
- if (inner->op == ShlInt32) {
- if (auto* innerConst = inner->right->dynCast<Const>()) {
- if (outerConst->value.leU(innerConst->value).geti32()) {
- return inner->left;
+ if (outerConst->value.geti32() != 0) {
+ if (auto* inner = outer->left->dynCast<Binary>()) {
+ if (inner->op == ShlInt32) {
+ if (auto* innerConst = inner->right->dynCast<Const>()) {
+ if (outerConst->value.leU(innerConst->value).geti32()) {
+ return inner->left;
+ }
}
}
}