summaryrefslogtreecommitdiff
path: root/re.c
diff options
context:
space:
mode:
Diffstat (limited to 're.c')
-rw-r--r--re.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/re.c b/re.c
index 2a7f475bd5..30f3066235 100644
--- a/re.c
+++ b/re.c
@@ -428,12 +428,16 @@ rb_reg_search(reg, str, start, reverse)
else if (reg_kcode != curr_kcode)
kcode_reset_option();
+#ifdef USE_THREAD
if (rb_thread_scope_shared_p()) {
match = Qnil;
}
else {
match = rb_backref_get();
}
+#else
+ match = rb_backref_get();
+#endif
if (NIL_P(match)) {
if (matchcache) {
match = matchcache;