aboutsummaryrefslogtreecommitdiffstats
path: root/erts
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2016-10-02 22:51:49 +0200
committerSverker Eriksson <[email protected]>2016-10-14 14:29:17 +0200
commitd9e8fa3d13be54246297ac9776e835ce0bdcd362 (patch)
tree8a4b18a1378dee9bbe1e640d26305ae7cccff5dc /erts
parent663360ea2bb7766ad2015fff7f3f8a8f53c3eef2 (diff)
downloadotp-d9e8fa3d13be54246297ac9776e835ce0bdcd362.tar.gz
otp-d9e8fa3d13be54246297ac9776e835ce0bdcd362.tar.bz2
otp-d9e8fa3d13be54246297ac9776e835ce0bdcd362.zip
erts: Free hipe_refs and hipe_sdesc of a failed load
Diffstat (limited to 'erts')
-rw-r--r--erts/emulator/hipe/hipe_load.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/erts/emulator/hipe/hipe_load.c b/erts/emulator/hipe/hipe_load.c
index 6261857d8f..c05dd886a4 100644
--- a/erts/emulator/hipe/hipe_load.c
+++ b/erts/emulator/hipe/hipe_load.c
@@ -31,6 +31,7 @@
#include "global.h"
#include "erl_binary.h"
#include "hipe_load.h"
+#include "hipe_bif0.h"
void hipe_free_loader_state(HipeLoaderState *stp)
{
@@ -51,12 +52,16 @@ void hipe_free_loader_state(HipeLoaderState *stp)
stp->data_segment = NULL;
stp->data_segment_size = 0;
- stp->module = NIL;
+ if (stp->new_hipe_refs) {
+ hipe_purge_refs(stp->new_hipe_refs, stp->module);
+ stp->new_hipe_refs = NULL;
+ }
+ if (stp->new_hipe_sdesc) {
+ hipe_purge_sdescs(stp->new_hipe_sdesc, stp->module);
+ stp->new_hipe_sdesc = NULL;
+ }
- ASSERT(!stp->new_hipe_refs && !stp->new_hipe_sdesc);
- /* ToDO: Purge lists 'new_hipe_refs' and 'new_hipe_sdesc'
- * if this is a failed load.
- */
+ stp->module = NIL;
}
static void