StanfordPL / x64asm

x86-64 assembler library
Apache License 2.0
470 stars 60 forks source link

Parser parses all memory dereferences as 8-bit #233

Closed bchurchill closed 8 years ago

bchurchill commented 8 years ago

This generally isn't a problem for assembling parsed code, but it's a problem if you rely on the reported width of a memory operand being correct (via Operand::size()).

bchurchill commented 8 years ago

Unfortunately, I don't know an easy way to fix this because the parser for Operands doesn't have enough conctext to know what opcode it's going to be associated with.

bchurchill commented 8 years ago

Apparently there's code (which I probably wrote) involving the "set_type_maybe_unless_I_know_better_hack" function that's supposed to handle this, but it's not working properly. To fix this, someone would need to investigate.

stefanheule commented 8 years ago

That's code the two of use wrote together to fix some other issue. Sounds like we really need to fix the operand hierarchy and make sure we don't cast things from one thing to another all over the place. This has cause SO MANY problems, and probably is even the cause for several open tickets (I'm pretty sure it's the cause of https://github.com/StanfordPL/stoke/issues/765).

stefanheule commented 8 years ago

We could get together in Gates some time and just work through this together and fix it once and for all, without any stupid hacks.