diff --git a/src/ir/effects.h b/src/ir/effects.h index b9e07a87bf8..1a7f4af616b 100644 --- a/src/ir/effects.h +++ b/src/ir/effects.h @@ -1027,9 +1027,8 @@ class EffectAnalyzer { } parent.readsArray = true; parent.writesArray = true; - if (curr->ref->type.isNullable()) { - parent.implicitTrap = true; - } + // traps when the arg is null or the index out of bounds + parent.implicitTrap = true; assert(curr->order != MemoryOrder::Unordered); parent.isAtomic = true; } @@ -1040,9 +1039,8 @@ class EffectAnalyzer { } parent.readsArray = true; parent.writesArray = true; - if (curr->ref->type.isNullable()) { - parent.implicitTrap = true; - } + // traps when the arg is null or the index out of bounds + parent.implicitTrap = true; assert(curr->order != MemoryOrder::Unordered); parent.isAtomic = true; }