emproof-com / nyxstone

Nyxstone: assembly / disassembly library based on LLVM, implemented in C++ with Rust and Python bindings, maintained by emproof.com
https://www.emproof.com
MIT License
311 stars 14 forks source link

Segfaults when assembling branches without defining the label #45

Closed stuxnot closed 3 months ago

stuxnot commented 9 months ago

Assembling b label on armv7m without defining label leads to a segfault. This seems to stem from the fact that the validation logic tries to get the symbol address, but cannot actually find an offset for the symbol. We should add some validation logic which checks that a symbol actually exists when assembling, this would also fix issues with nyxstone assembling branches to undefined labels as branches to some indeterminate value.