Fixed a bug with the opcode and register types not being set correctly.

This commit is contained in:
2022-02-22 21:09:04 -06:00
parent 19021ff782
commit 1fd5c3af57
+2 -2
View File
@@ -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 = &registers[i].type;
*reg = registers[i].type;
return 1;
}
}