mirror of
https://github.com/yuzu-emu/breakpad.git
synced 2024-11-24 13:25:46 +01:00
libdisasm: Don't depend on sizeof(void)
Due to operator precedence, the address was first cast to void* and then incremented, which resulted in an error on windows, as sizeof(void) is undefined and MSVC takes this seriously. Changing the precedence to perform the addition first. R=mark@chromium.org Review URL: https://codereview.chromium.org/1570843002 . Patch from Pavel Labath <labath@google.com>.
This commit is contained in:
parent
68039850bc
commit
2dda5fefdc
6
src/third_party/libdisasm/x86_disasm.c
vendored
6
src/third_party/libdisasm/x86_disasm.c
vendored
@ -35,7 +35,7 @@ unsigned int x86_disasm( unsigned char *buf, unsigned int buf_len,
|
||||
|
||||
if ( offset >= buf_len ) {
|
||||
/* another caller screwup ;) */
|
||||
x86_report_error(report_disasm_bounds, (void*)(long)buf_rva+offset);
|
||||
x86_report_error(report_disasm_bounds, (void*)(long)(buf_rva+offset));
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -53,13 +53,13 @@ unsigned int x86_disasm( unsigned char *buf, unsigned int buf_len,
|
||||
|
||||
/* check and see if we had an invalid instruction */
|
||||
if (! size ) {
|
||||
x86_report_error(report_invalid_insn, (void*)(long)buf_rva+offset );
|
||||
x86_report_error(report_invalid_insn, (void*)(long)(buf_rva+offset));
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* check if we overran the end of the buffer */
|
||||
if ( size > len ) {
|
||||
x86_report_error( report_insn_bounds, (void*)(long)buf_rva + offset );
|
||||
x86_report_error( report_insn_bounds, (void*)(long)(buf_rva + offset));
|
||||
MAKE_INVALID( insn, bytes );
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user