diff options
author | Lukas Larsson <[email protected]> | 2016-05-12 17:37:40 +0200 |
---|---|---|
committer | Lukas Larsson <[email protected]> | 2016-05-17 14:58:07 +0200 |
commit | 32a8787eb7651d41371afdf3f55fd3a77486861d (patch) | |
tree | 3343c0940936683eb42b032653ddb9c6972e9baf /erts/emulator/beam/erl_bif_re.c | |
parent | 49d43cd5c5058b5244d0b8e57667fb22c7eb3a09 (diff) | |
download | otp-32a8787eb7651d41371afdf3f55fd3a77486861d.tar.gz otp-32a8787eb7651d41371afdf3f55fd3a77486861d.tar.bz2 otp-32a8787eb7651d41371afdf3f55fd3a77486861d.zip |
erts: Fix OpenBSD gcc compiler bug in re code
The OpenBSD 5.8 gcc compiler emits erroneous code
which results in the re:run function behaving badly,
though strangely enough it does not segfault the vm.
This fix moves code around a bit in order to make gcc
emit correct code.
Diffstat (limited to 'erts/emulator/beam/erl_bif_re.c')
-rw-r--r-- | erts/emulator/beam/erl_bif_re.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/erts/emulator/beam/erl_bif_re.c b/erts/emulator/beam/erl_bif_re.c index f4daecd2a4..ff7746ce1d 100644 --- a/erts/emulator/beam/erl_bif_re.c +++ b/erts/emulator/beam/erl_bif_re.c @@ -630,9 +630,15 @@ static Eterm build_exec_return(Process *p, int rc, RestartContext *restartp, Ete } } else { ReturnInfo *ri; - ReturnInfo defri = {RetIndex,0,{0}}; + ReturnInfo defri; if (restartp->ret_info == NULL) { + /* OpenBSD 5.8 gcc compiler for some reason creates + bad code if the above initialization is done + inline with the struct. So don't do that. */ + defri.type = RetIndex; + defri.num_spec = 0; + defri.v[0] = 0; ri = &defri; } else { ri = restartp->ret_info; |