Created
March 31, 2014 15:04
-
-
Save k-tsj/9894424 to your computer and use it in GitHub Desktop.
Patch for SymbolGC SEGV
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/parse.y b/parse.y | |
index 3f756ce..680242d 100644 | |
--- a/parse.y | |
+++ b/parse.y | |
@@ -10705,7 +10705,13 @@ rb_str_dynamic_intern(VALUE str) | |
ID id, type; | |
if (st_lookup(global_symbols.sym_id, str, &id)) { | |
- return ID2SYM(id); | |
+ VALUE sym = ID2SYM(id); | |
+ if (!STATIC_SYM_P(sym)) { | |
+ /* because of lazy sweep, dynamic symbol may be unmarked already and swept | |
+ * at next time */ | |
+ rb_gc_resurrect(sym); | |
+ } | |
+ return sym; | |
} | |
enc = rb_enc_get(str); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment