Skip to content

Commit e425b37

Browse files
Fixed BIT access inside array (after AND with const fix).
1 parent 7fceac3 commit e425b37

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

ugbc/src/targets/common/_infrastructure.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8453,13 +8453,13 @@ void variable_store_array_const_bit( Environment * _environment, Variable * _arr
84538453

84548454
variable_move( _environment, offset->name, position->name );
84558455

8456-
variable_and_const( _environment, position->name, 7 );
8456+
Variable * positionInside = variable_and_const( _environment, position->name, 7 );
84578457

84588458
offset = variable_sr_const( _environment, offset->name, 3 );
84598459

84608460
cpu_math_add_16bit_with_16bit( _environment, offset->realName, _array->realName, offset->realName );
84618461

8462-
cpu_bit_inplace_8bit_extended_indirect( _environment, offset->realName, position->realName, value->realName );
8462+
cpu_bit_inplace_8bit_extended_indirect( _environment, offset->realName, positionInside->realName, value->realName );
84638463

84648464
}
84658465

@@ -8603,13 +8603,13 @@ void variable_move_array_bit( Environment * _environment, Variable * _array, Var
86038603

86048604
variable_move( _environment, offset->name, position->name );
86058605

8606-
variable_and_const( _environment, position->name, 7 );
8606+
Variable * positionInside = variable_and_const( _environment, position->name, 7 );
86078607

86088608
offset = variable_sr_const( _environment, offset->name, 3 );
86098609

86108610
cpu_math_add_16bit_with_16bit( _environment, offset->realName, _array->realName, offset->realName );
86118611

8612-
cpu_bit_inplace_8bit_extended_indirect( _environment, offset->realName, position->realName, _value->realName );
8612+
cpu_bit_inplace_8bit_extended_indirect( _environment, offset->realName, positionInside->realName, _value->realName );
86138613

86148614
}
86158615

@@ -8867,7 +8867,7 @@ Variable * variable_move_from_array_bit( Environment * _environment, Variable *
88678867
Variable * offset = calculate_offset_in_array( _environment, _array->name );
88688868
Variable * position = variable_temporary( _environment, VT_BYTE, "(position)");
88698869
variable_move( _environment, offset->name, position->name );
8870-
variable_and_const( _environment, position->name, 7 );
8870+
Variable * positionInside = variable_and_const( _environment, position->name, 7 );
88718871
offset = variable_sr_const( _environment, offset->name, 3 );
88728872

88738873
cpu_math_add_16bit_with_16bit( _environment, offset->realName, _array->realName, offset->realName );
@@ -8876,7 +8876,7 @@ Variable * variable_move_from_array_bit( Environment * _environment, Variable *
88768876

88778877
MAKE_LABEL
88788878

8879-
cpu_bit_check_extended( _environment, tmp->realName, position->realName, NULL, 8 );
8879+
cpu_bit_check_extended( _environment, tmp->realName, positionInside->realName, NULL, 8 );
88808880

88818881
cpu_bit_inplace_8bit( _environment, result->realName, result->bitPosition, NULL );
88828882

0 commit comments

Comments
 (0)