Skip to content

Commit

Permalink
Add check return values from encode and decode
Browse files Browse the repository at this point in the history
  • Loading branch information
kuhanov committed Sep 22, 2023
1 parent 4349ac9 commit 68cd9c3
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions suite/tests/api/drdecode_x86.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,12 +155,12 @@ test_noalloc(void)
*/
}

#define CHECK_CATEGORY(dcontext, instr, pc, category) \
instr_encode(dcontext, instr, pc); \
instr_reset(dcontext, instr); \
instr_set_operands_valid(instr, true); \
decode(dcontext, pc, instr); \
ASSERT(instr_get_category(instr) == category); \
#define CHECK_CATEGORY(dcontext, instr, pc, category) \
ASSERT(instr_encode(dcontext, instr, pc) - pc < BUFFER_SIZE_ELEMENTS(pc)); \
instr_reset(dcontext, instr); \
instr_set_operands_valid(instr, true); \
ASSERT(decode(dcontext, pc, instr) != NULL); \
ASSERT(instr_get_category(instr) == category); \
instr_destroy(dcontext, instr);

static void
Expand Down

0 comments on commit 68cd9c3

Please sign in to comment.