aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2011-12-06 11:33:49 +0100
committerSverker Eriksson <[email protected]>2011-12-06 11:33:49 +0100
commit823a2eda6a6f3d5b8250a448a180317b7d5ab329 (patch)
tree1478e0d11f0cee9a1caad2895ca9bcf8447520bb /erts/emulator
parent026a7c04fdf7add071ee61b1ac24a5ebbcbb73db (diff)
parentf04edcbd8bd692a953164f143fa7c2b496525394 (diff)
downloadotp-823a2eda6a6f3d5b8250a448a180317b7d5ab329.tar.gz
otp-823a2eda6a6f3d5b8250a448a180317b7d5ab329.tar.bz2
otp-823a2eda6a6f3d5b8250a448a180317b7d5ab329.zip
Merge branch 'sverk/ppc-hibernate-fix'
* sverk/ppc-hibernate-fix: erts: Fix hipe bug in hibernate on PowerPC
Diffstat (limited to 'erts/emulator')
-rw-r--r--erts/emulator/hipe/hipe_mode_switch.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/erts/emulator/hipe/hipe_mode_switch.c b/erts/emulator/hipe/hipe_mode_switch.c
index 4d75883fc5..6a3ce5608f 100644
--- a/erts/emulator/hipe/hipe_mode_switch.c
+++ b/erts/emulator/hipe/hipe_mode_switch.c
@@ -337,14 +337,22 @@ Process *hipe_mode_switch(Process *p, unsigned cmd, Eterm reg[])
* stack: to this end hipe_${ARCH}_glue.S stores the BIF's
* arity in p->hipe.narity.
*
- * If the BIF emptied the stack (typically hibernate), p->hipe.nsp is
- * NULL and there is no need to get rid of stacked parameters.
+ * If the BIF emptied the stack (typically hibernate), p->hipe.nstack
+ * is NULL and there is no need to get rid of stacked parameters.
*/
unsigned int i, is_recursive = 0;
- if (p->hipe.nsp != NULL) {
+ if (p->hipe.nstack != NULL) {
+ ASSERT(p->hipe.nsp != NULL);
is_recursive = hipe_trap_from_native_is_recursive(p);
}
+ else {
+ /* Some architectures (risc) need this re-reset of nsp as the
+ * BIF wrapper do not detect stack change and causes an obsolete
+ * stack pointer to be saved in p->hipe.nsp before return to us.
+ */
+ p->hipe.nsp = NULL;
+ }
/* Schedule next process if current process was hibernated or is waiting
for messages */