yrp604 / rappel

A linux-based assembly REPL for x86, amd64, armv7, and armv8
Other
1.16k stars 55 forks source link

Initialize buf, properly log invalid assembly, fix some typos #24

Closed pmeerw closed 5 years ago

pmeerw commented 5 years ago

This fixes two issues as illustrated below. First, 'buf' is not initialized, thus strings might not be zero-terminated (notice 'QV' random characters below). Second, invalid instructions are not logged since 'buf' is cleared beforehand (notice '' below).

Trying to assemble (4):
nop
QVnasm is pid 10515
Got asm(1):
90

Trying to assemble (5):
crap
nasm is pid 10533
/dev/fd/3:3: warning: label alone on a line without a colon might be in error [>
Got asm(0):
'' assembled to 0 length bytecode
yrp604 commented 5 years ago

Hey, sorry for the delay on this and thanks for reporting it. I think I've fixed it, albeit in a different way on the garbage-display branch with 11df04b92a32c50e2323a8b44cd509697defcc5c. Could you take a look and see if that addresses the issue?

Thanks!

yrp604 commented 5 years ago

closed in #26, thanks again for pointing this out and the followup review.