fix use of cpp syntax

This commit is contained in:
EDiasAlberto 2024-06-06 17:10:18 +01:00
parent 9c6a459b23
commit 225ade7770

View File

@ -84,8 +84,13 @@ void generateBranchOperands(a64inst_instruction *instr, char* opcode, char *oper
}
void classifyOpcode(char* opcode, a64inst_instruction *instr, char *operandList[]){
if((int isUnconditional = strcmp(opcode, "b")) == 0 ||
(int isRegister = strcmp(opcode, "br")) == 0 ||
int isUnconditional = strcmp(opcode, "b");
int isRegister = strcmp(opcode, "br");
int isLoad = strcmp(opcode, "ldr");
int isStore = strcmp(opcode, "str");
if(isUnconditional == 0 ||
isRegister == 0 ||
strncmp(opcode, "b.", 2) == 0){
instr->type = a64inst_BRANCH;
if(isUnconditional){
@ -97,7 +102,7 @@ void classifyOpcode(char* opcode, a64inst_instruction *instr, char *operandList[
//instr->data.branchData.processOpData.cond = {remove first two chars of opcode}
}
generateBranchOperands(instr, opcode, operandList);
} else if((int isLoad = strcmp(opcode, "ldr")) == 0 || (int isStore = strcmp(opcode, "str")) == 0){
} else if(isLoad == 0 || isStore == 0){
//loading/storing instruction; classify operands
char *address = operandList[1];
if( *address == '['){