hydrogen-cpp
hydrogen-cpp copied to clipboard
Exit Exits twice
the code exit(12) produces the following ASM
global _start _start: ;; exit mov rax, 12 push rax mov rax, 60 pop rdi syscall ;; /exit mov rax, 60 mov rdi, 0 syscall
the program exits twice.
I believe he's intentionally adding an exit at the end of a program (even if you didnt add it yourself), which would mean that this isn't a bug (and you can't really exit twice, it exists and the second one isnt executed)
I believe he's intentionally adding an exit at the end of a program (even if you didnt add it yourself), which would mean that this isn't a bug (and you can't really exit twice, it exists and the second one isnt executed)
This seems to be the case (check Line 247 of generation.hpp)
Ok. I would change it to only add an exit if there is no exit declared in the program
Ok. I would change it to only add an exit if there is no exit declared in the program
Personally I'd just leave it as is.