Skip to content

Commit 515ebdd

Browse files
committed
CI lazy methods: scan global initialisers for global references
CI lazy methods now notices cases like global g1 having initialiser &g2, in which case having a reference to global g1 implies a reference to global g2. Currently this only happens in the string solver in Java, where a literal's initialiser references a constant array global.
1 parent 6844760 commit 515ebdd

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/java_bytecode/ci_lazy_methods.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,8 @@ void ci_lazy_methodst::gather_needed_globals(
479479
findit->second.is_static_lifetime)
480480
{
481481
needed.add(findit->second);
482+
// Gather any globals referenced in the initialiser:
483+
gather_needed_globals(findit->second.value, symbol_table, needed);
482484
}
483485
}
484486
else

0 commit comments

Comments
 (0)