Skip to content

Commit 5b2ec0e

Browse files
committed
Save ns that may be clobbered by setjmp/longjmp
1 parent c93b521 commit 5b2ec0e

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

load.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1289,14 +1289,15 @@ require_internal(rb_execution_context_t *ec, VALUE fname, int exception, bool wa
12891289
{
12901290
volatile int result = -1;
12911291
rb_thread_t *th = rb_ec_thread_ptr(ec);
1292+
const rb_namespace_t *ns = rb_loading_namespace();
12921293
volatile const struct {
12931294
VALUE wrapper, self, errinfo;
12941295
rb_execution_context_t *ec;
1296+
const rb_namespace_t *ns;
12951297
} saved = {
12961298
th->top_wrapper, th->top_self, ec->errinfo,
1297-
ec,
1299+
ec, ns,
12981300
};
1299-
const rb_namespace_t *ns = rb_loading_namespace();
13001301
enum ruby_tag_type state;
13011302
char *volatile ftptr = 0;
13021303
VALUE path;
@@ -1365,6 +1366,7 @@ require_internal(rb_execution_context_t *ec, VALUE fname, int exception, bool wa
13651366
EC_POP_TAG();
13661367

13671368
ec = saved.ec;
1369+
ns = saved.ns;
13681370
rb_thread_t *th2 = rb_ec_thread_ptr(ec);
13691371
th2->top_self = saved.self;
13701372
th2->top_wrapper = saved.wrapper;

0 commit comments

Comments
 (0)