Merge pull request #43 from tekknolagi/main

Use size-specific MAX/MIN constants
This commit is contained in:
Kartik Agaram 2020-10-22 14:13:36 -07:00 committed by GitHub
commit 3bb27a628a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -61,7 +61,7 @@ void test_add_r32_to_r32_signed_overflow() {
}
void test_add_r32_to_r32_unsigned_overflow() {
Reg[EAX].u = UINT_MAX;
Reg[EAX].u = UINT32_MAX;
Reg[EBX].u = 1;
run(
"== code 0x1\n" // code segment
@ -374,7 +374,7 @@ case 3: { // negate r/m32
:(code)
// negate can overflow in exactly one situation
void test_negate_can_overflow() {
Reg[EBX].i = 0x80000000; // INT_MIN
Reg[EBX].i = INT32_MIN;
run(
"== code 0x1\n" // code segment
// op ModR/M SIB displacement immediate

View File

@ -99,7 +99,7 @@ void test_add_mem_at_rm32_to_r32_signed_overflow() {
void test_add_mem_at_rm32_to_r32_unsigned_overflow() {
Reg[EAX].u = 0x2000;
Reg[EBX].u = UINT_MAX;
Reg[EBX].u = UINT32_MAX;
run(
"== code 0x1\n"
// op ModR/M SIB displacement immediate