From 1fd5c3af57037d9ace6ee801f4190828d51fe67c Mon Sep 17 00:00:00 2001 From: Garritt McCune Date: Tue, 22 Feb 2022 21:09:04 -0600 Subject: [PATCH] Fixed a bug with the opcode and register types not being set correctly. --- src/opcodes.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/opcodes.c b/src/opcodes.c index 9b91ec4..a84dcba 100644 --- a/src/opcodes.c +++ b/src/opcodes.c @@ -31,7 +31,7 @@ int IsOpcode(const char* text, TokenType* opcode) { for(int i = 0; i < OPCODECOUNT; i++) { if (strcmp(opcodes[i].lexeme, text) == 0) { - opcode = &opcodes[i].op; + *opcode = opcodes[i].op; return 1; } } @@ -44,7 +44,7 @@ int IsRegister(const char* text, TokenType* reg) { for(int i = 0; i < REGISTERCOUNT; i++) { if (strcmp(registers[i].lexeme, text) == 0) { - reg = ®isters[i].type; + *reg = registers[i].type; return 1; } }