aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/hipe/hipe_ppc.c
diff options
context:
space:
mode:
authorMikael Pettersson <[email protected]>2015-01-11 16:48:20 +0100
committerMarcus Arendt <[email protected]>2015-01-26 15:57:04 +0100
commit3d41006a0e17d57fef4324c2a49c778f7a4a3390 (patch)
tree3bef60849913ccfabfc605a78d542cb955f70154 /erts/emulator/hipe/hipe_ppc.c
parent14d585fdcafad61a377feeba1035d6ddcfaf0248 (diff)
downloadotp-3d41006a0e17d57fef4324c2a49c778f7a4a3390.tar.gz
otp-3d41006a0e17d57fef4324c2a49c778f7a4a3390.tar.bz2
otp-3d41006a0e17d57fef4324c2a49c778f7a4a3390.zip
hipe: improve error handling at code allocation failure
Diffstat (limited to 'erts/emulator/hipe/hipe_ppc.c')
-rw-r--r--erts/emulator/hipe/hipe_ppc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/erts/emulator/hipe/hipe_ppc.c b/erts/emulator/hipe/hipe_ppc.c
index 4dc26cdbc8..1eaa9f6855 100644
--- a/erts/emulator/hipe/hipe_ppc.c
+++ b/erts/emulator/hipe/hipe_ppc.c
@@ -293,6 +293,8 @@ void *hipe_make_native_stub(void *callee_exp, unsigned int beamArity)
abort();
code = alloc_stub(7);
+ if (!code)
+ return NULL;
/* addis r12,0,callee_exp@highest */
code[0] = 0x3d800000 | (((unsigned long)callee_exp >> 48) & 0xffff);
@@ -381,6 +383,8 @@ void *hipe_make_native_stub(void *callee_exp, unsigned int beamArity)
abort();
code = alloc_stub(4);
+ if (!code)
+ return NULL;
/* addi r12,0,callee_exp@l */
code[0] = 0x39800000 | ((unsigned long)callee_exp & 0xFFFF);