@@ -97,11 +97,11 @@ private void promoteAll(Function function, Matcher matcher) {
9797 if (event instanceof Load load ) {
9898 final Register reg = load .getResultRegister ();
9999 assert load .getUsers ().isEmpty ();
100- load .replaceBy (EventFactory .newLocal (reg , expressions .makeCast (registers .get (access .offset ), reg .getType ())));
100+ load .replaceBy (EventFactory .newLocal (reg , expressions .makeCast (registers .get (( int ) access .offset ), reg .getType ())));
101101 loadCount ++;
102102 }
103103 if (event instanceof Store store ) {
104- final Register reg = registers .get (access .offset );
104+ final Register reg = registers .get (( int ) access .offset );
105105 assert store .getUsers ().isEmpty ();
106106 store .replaceBy (EventFactory .newLocal (reg , expressions .makeCast (store .getMemValue (), reg .getType ())));
107107 storeCount ++;
@@ -142,14 +142,14 @@ private List<Type> getPrimitiveReplacementTypes(Alloc allocation) {
142142 }
143143
144144 // Invariant: base != null
145- private record AddressOffset (RegWriter base , int offset ) {
146- private AddressOffset increase (int o ) {
145+ private record AddressOffset (RegWriter base , long offset ) {
146+ private AddressOffset increase (long o ) {
147147 return o == 0 ? this : new AddressOffset (base , offset + o );
148148 }
149149 }
150150
151151 // Invariant: register != null
152- private record RegisterOffset (Register register , int offset ) {}
152+ private record RegisterOffset (Register register , long offset ) {}
153153
154154 // Processes events in program order.
155155 // Returns a label, if it is program-ordered before the current event and its symbolic state was updated.
@@ -327,14 +327,14 @@ private void publishRegisters(Set<Register> registers) {
327327 }
328328
329329 private RegisterOffset matchGEP (Expression expression ) {
330- int sum = 0 ;
330+ long sum = 0 ;
331331 while (!(expression instanceof Register register )) {
332332 if (!(expression instanceof IntBinaryExpr bin ) ||
333333 bin .getKind () != IntBinaryOp .ADD ||
334334 !(bin .getRight () instanceof IntLiteral offset )) {
335335 return null ;
336336 }
337- sum += offset .getValueAsInt ();
337+ sum += offset .getValueAsLong ();
338338 expression = bin .getLeft ();
339339 }
340340 return new RegisterOffset (register , sum );
0 commit comments