aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam
diff options
context:
space:
mode:
authorRickard Green <[email protected]>2018-08-09 17:18:42 +0200
committerRickard Green <[email protected]>2018-08-09 17:18:42 +0200
commit747e9df470dc18688305b4ea333803ee2d81167c (patch)
tree34bebd52668f9963c1f3b8ff0e2963312b380509 /erts/emulator/beam
parentf2c683c321baccc53b68fd4114b49ad4c72c90aa (diff)
parent30eedd359ce5f6aa3f9b3dbbfbee4afe34ca3ce6 (diff)
downloadotp-747e9df470dc18688305b4ea333803ee2d81167c.tar.gz
otp-747e9df470dc18688305b4ea333803ee2d81167c.tar.bz2
otp-747e9df470dc18688305b4ea333803ee2d81167c.zip
Merge branch 'maint'
* maint: Fix caching of NIF environment when executing dirty
Diffstat (limited to 'erts/emulator/beam')
-rw-r--r--erts/emulator/beam/erl_nif.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/erts/emulator/beam/erl_nif.c b/erts/emulator/beam/erl_nif.c
index 8583dd9a7a..7339aa8874 100644
--- a/erts/emulator/beam/erl_nif.c
+++ b/erts/emulator/beam/erl_nif.c
@@ -453,8 +453,18 @@ static void full_flush_env(ErlNifEnv* env)
static void full_cache_env(ErlNifEnv* env)
{
- if (env->proc->static_flags & ERTS_STC_FLG_SHADOW_PROC)
+ if (env->proc->static_flags & ERTS_STC_FLG_SHADOW_PROC) {
erts_cache_dirty_shadow_proc(env->proc);
+ /*
+ * If shadow proc had heap fragments when flushed
+ * those have now been moved to the real proc.
+ * Ensure heap pointers do not point into a heap
+ * fragment on real proc...
+ */
+ ASSERT(!env->proc->mbuf);
+ env->hp_end = HEAP_LIMIT(env->proc);
+ env->hp = HEAP_TOP(env->proc);
+ }
cache_env(env);
}