From 8191273a3de6df8531805fbfb1a9b6e5a18076a2 Mon Sep 17 00:00:00 2001 From: Subv Date: Mon, 30 Jul 2018 20:09:49 -0500 Subject: MacroInterpreter: Avoid left shifting negative values. The branch target is signed, so multiply by 4 instead of left shifting by 2 --- src/video_core/macro_interpreter.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/video_core/macro_interpreter.h') diff --git a/src/video_core/macro_interpreter.h b/src/video_core/macro_interpreter.h index a71e359d8..7d836b816 100644 --- a/src/video_core/macro_interpreter.h +++ b/src/video_core/macro_interpreter.h @@ -91,6 +91,10 @@ private: u32 GetBitfieldMask() const { return (1 << bf_size) - 1; } + + s32 GetBranchTarget() const { + return static_cast(immediate * sizeof(u32)); + } }; union MethodAddress { -- cgit v1.2.3