summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gc.c b/gc.c
index 1503d42a74..e5ecea76f4 100644
--- a/gc.c
+++ b/gc.c
@@ -863,8 +863,9 @@ gc_sweep()
int freed = 0;
int i, used = heaps_used;
- if (ruby_in_compile) {
- /* should not reclaim nodes during compilation */
+ if (ruby_in_compile && ruby_parser_stack_on_heap()) {
+ /* should not reclaim nodes during compilation
+ if yacc's semantic stack is not allocated on machine stack */
for (i = 0; i < used; i++) {
p = heaps[i]; pend = p + heaps_limits[i];
while (p < pend) {