diff options
Diffstat (limited to 'src/ir/effects.h')
-rw-r--r-- | src/ir/effects.h | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/src/ir/effects.h b/src/ir/effects.h index 9d6e90936..b973d7446 100644 --- a/src/ir/effects.h +++ b/src/ir/effects.h @@ -428,7 +428,8 @@ struct EffectAnalyzer implicitTrap = true; break; } - default: {} + default: { + } } } } @@ -446,17 +447,27 @@ struct EffectAnalyzer implicitTrap = true; break; } - default: {} + default: { + } } } } void visitSelect(Select* curr) {} void visitDrop(Drop* curr) {} void visitReturn(Return* curr) { branchesOut = true; } - void visitHost(Host* curr) { + void visitMemorySize(MemorySize* curr) { + // memory.size accesses the size of the memory, and thus can be modeled as + // reading memory + readsMemory = true; + // Atomics are sequentially consistent with memory.size. + isAtomic = true; + } + void visitMemoryGrow(MemoryGrow* curr) { calls = true; - // memory.grow modifies the set of valid addresses, and thus can be modeled - // as modifying memory + // memory.grow technically does a read-modify-write operation on the memory + // size in the successful case, modifying the set of valid addresses, and + // just a read operation in the failure case + readsMemory = true; writesMemory = true; // Atomics are also sequentially consistent with memory.grow. isAtomic = true; |