Re: [GXemul-devel] NetBSD/hpcmips install fails under GXemul 0.6.1
Status: Alpha
Brought to you by:
gavare
From: Anders G. <ga...@gm...> - 2019-06-06 12:23:07
|
> Looks like the code has undefined behavior: init_bootpath is set to > point to the local variable bootpath[], but by the time init_bootpath > is used as the source in strlcpy(), bootpath[] has already gone out of > scope. Horrible and embarrassing. :-| But interesting at the same time. It feels like the compiler took the opportunity to optimize away the undefined code. It would have been nice to get a warning from the compiler though, something like "taking the address to a temporary stack variable and using it after it has gone out of scope" etc. Moving bootpath to the top of the function should work then: https://pastebin.com/FXMKvCQC Anders |