From 69cf5b12f15052f762deb95dba263f155bd06972 Mon Sep 17 00:00:00 2001 From: Rekai Musuka Date: Sun, 3 Jul 2022 08:59:44 -0300 Subject: [PATCH] fix: remove undefined --- src/cpu/arm/data_processing.zig | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/cpu/arm/data_processing.zig b/src/cpu/arm/data_processing.zig index e34114a..26cc863 100644 --- a/src/cpu/arm/data_processing.zig +++ b/src/cpu/arm/data_processing.zig @@ -17,13 +17,8 @@ pub fn dataProcessing(comptime I: bool, comptime S: bool, comptime instrKind: u4 if (!I and opcode >> 4 & 1 == 1) cpu.r[15] += 4; const op1 = cpu.r[rn]; - var op2: u32 = undefined; - if (I) { - const amount = @truncate(u8, (opcode >> 8 & 0xF) << 1); - op2 = rotateRight(S, &cpu.cpsr, opcode & 0xFF, amount); - } else { - op2 = execute(S, cpu, opcode); - } + const amount = @truncate(u8, (opcode >> 8 & 0xF) << 1); + const op2 = if (I) rotateRight(S, &cpu.cpsr, opcode & 0xFF, amount) else execute(S, cpu, opcode); // Undo special condition from above if (!I and opcode >> 4 & 1 == 1) cpu.r[15] -= 4;