summaryrefslogtreecommitdiff
path: root/src/video_core/macro_interpreter.cpp
diff options
context:
space:
mode:
authorGravatar bunnei2018-07-31 09:24:13 -0700
committerGravatar GitHub2018-07-31 09:24:13 -0700
commit3575c076cb12db611c5d252bd647a236b789f53f (patch)
treeaa2d9a1086132095a9f50749920288dcb1e279ad /src/video_core/macro_interpreter.cpp
parentMerge pull request #875 from lioncash/fgm (diff)
parentMacroInterpreter: Avoid left shifting negative values. (diff)
downloadyuzu-3575c076cb12db611c5d252bd647a236b789f53f.tar.gz
yuzu-3575c076cb12db611c5d252bd647a236b789f53f.tar.xz
yuzu-3575c076cb12db611c5d252bd647a236b789f53f.zip
Merge pull request #869 from Subv/ubsan
Corrected a few error cases detected by asan/ubsan
Diffstat (limited to 'src/video_core/macro_interpreter.cpp')
-rw-r--r--src/video_core/macro_interpreter.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/video_core/macro_interpreter.cpp b/src/video_core/macro_interpreter.cpp
index 44ece01c1..377bd66ab 100644
--- a/src/video_core/macro_interpreter.cpp
+++ b/src/video_core/macro_interpreter.cpp
@@ -102,11 +102,11 @@ bool MacroInterpreter::Step(const std::vector<u32>& code, bool is_delay_slot) {
102 if (taken) { 102 if (taken) {
103 // Ignore the delay slot if the branch has the annul bit. 103 // Ignore the delay slot if the branch has the annul bit.
104 if (opcode.branch_annul) { 104 if (opcode.branch_annul) {
105 pc = base_address + (opcode.immediate << 2); 105 pc = base_address + opcode.GetBranchTarget();
106 return true; 106 return true;
107 } 107 }
108 108
109 delayed_pc = base_address + (opcode.immediate << 2); 109 delayed_pc = base_address + opcode.GetBranchTarget();
110 // Execute one more instruction due to the delay slot. 110 // Execute one more instruction due to the delay slot.
111 return Step(code, true); 111 return Step(code, true);
112 } 112 }