mirror of
https://github.com/NishiOwO/JWasm.git
synced 2025-04-21 16:54:39 +00:00
Fix broken HIGHWORD-operator
The HIGHWORD-Operator was implemented as right shift by 16 of opnd1->value. This is wrong because: - the bits 32...63 are not zeroed - the compiler might do an arithmetic shift (typeof opnd1->value == int_32) As fix, the result of the right shift is masked (bitwise AND) and then assigned to the 64 bit value opnd1->llvalue. Resolves: #152 resp. SF-BUG-298
This commit is contained in:
parent
aa6cbc8fcf
commit
7338d820d4
@ -1488,7 +1488,7 @@ static ret_code highword_op( int oper, struct expr *opnd1, struct expr *opnd2, s
|
|||||||
//opnd1->mem_type = MT_WORD; /* v2.05 */
|
//opnd1->mem_type = MT_WORD; /* v2.05 */
|
||||||
opnd1->mem_type = MT_EMPTY;
|
opnd1->mem_type = MT_EMPTY;
|
||||||
}
|
}
|
||||||
opnd1->value = opnd1->value >> 16;
|
opnd1->llvalue = (opnd1->value >> 16) & 0xffff;
|
||||||
return( NOT_ERROR );
|
return( NOT_ERROR );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user