@@ -880,7 +880,7 @@ func (instruction *LoadInstruction) parse() error {
880
880
instruction .offset = uint (offset )
881
881
882
882
//check for alignment restriction
883
- if (instruction .reg2 + instruction .offset )% 4 != 0 {
883
+ if (getRegisterValue ( instruction .reg2 ) + int64 ( instruction .offset ) )% 4 != 0 {
884
884
return errors .New ("Alignment restriction violation in : " + instruction .inst )
885
885
}
886
886
@@ -939,7 +939,7 @@ func (instruction *StoreInstruction) parse() error {
939
939
instruction .offset = uint (offset )
940
940
941
941
//check for alignment restriction
942
- if (instruction .reg2 + instruction .offset )% 4 != 0 {
942
+ if (getRegisterValue ( instruction .reg2 ) + int64 ( instruction .offset ) )% 4 != 0 {
943
943
return errors .New ("Alignment restriction violation in : " + instruction .inst )
944
944
}
945
945
@@ -994,7 +994,7 @@ func (instruction *LoadHalfInstruction) parse() error {
994
994
instruction .offset = uint (offset )
995
995
996
996
//check for alignment restriction
997
- if (instruction .reg2 + instruction .offset )% 4 != 0 && (instruction .reg2 + instruction .offset )% 4 != 2 {
997
+ if (getRegisterValue ( instruction .reg2 ) + int64 ( instruction .offset )) % 4 != 0 && (getRegisterValue ( instruction .reg2 ) + int64 ( instruction .offset ) )% 4 != 2 {
998
998
return errors .New ("Alignment restriction violation in : " + instruction .inst )
999
999
}
1000
1000
@@ -1058,7 +1058,7 @@ func (instruction *StoreHalfInstruction) parse() error {
1058
1058
instruction .offset = uint (offset )
1059
1059
1060
1060
//check for alignment restriction
1061
- if (instruction .reg2 + instruction .offset )% 4 != 0 && (instruction .reg2 + instruction .offset )% 4 != 2 {
1061
+ if (getRegisterValue ( instruction .reg2 ) + int64 ( instruction .offset )) % 4 != 0 && (getRegisterValue ( instruction .reg2 ) + int64 ( instruction .offset ) )% 4 != 2 {
1062
1062
return errors .New ("Alignment restriction violation in : " + instruction .inst )
1063
1063
}
1064
1064
0 commit comments