Skip to content

Commit

Permalink
Allows pointer to be realloced
Browse files Browse the repository at this point in the history
  • Loading branch information
cheng-alvin committed Dec 1, 2023
1 parent c23f692 commit c3fb56d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 3 additions & 3 deletions libjas/aaa.c
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#include "codegen.h"
#include "error.h"
#include "init.h"
#include "write.h"
#include <stdint.h>

jasErrorCode_t aaa(jasOperand_t op1, jasOperand_t op2, jasOperand_t op3, jasOperand_t op4, uint8_t *buffer, jasInstance_t instance) {
// TODO Implement this!

jasErrorCode_t aaa(jasOperand_t op1, jasOperand_t op2, jasOperand_t op3, jasOperand_t op4, uint8_t **buffer, jasInstance_t instance) {
*buffer = write8(buffer, 0x37, sizeof(buffer) / sizeof(uint8_t));
return JAS_NO_ERROR;
}
4 changes: 1 addition & 3 deletions libjas/codegen.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,5 @@ jasErrorCode_t codegen(jasInstruction_t instruction, jasOperand_t op1, jasOperan
if (instruction > sizeof(jasInstructionEncoder) / sizeof(&aaa))
return JAS_ERROR_INVALID_INSTRUCTION;

jasInstructionEncoder[instruction](op1, op2, op3, op4, buf, instance);

return JAS_NO_ERROR;
return jasInstructionEncoder[instruction](op1, op2, op3, op4, &buf, instance);
}

0 comments on commit c3fb56d

Please sign in to comment.