Please sign in to comment.
Invalidate dynlex caches during deopt.
The dynlex cache may point into the lexicals buffer in a case where we have an inlined lexical. This is fine enough, until we deopt that frame. In that case, uninlining moves lexicals to live in a freshly created frame, leaving the dynlex cache pointing into the place the lexical used to be. If lexical gets rebound then we'd look up an old value; worse, if GC happens then we can end up with dynamic lexical lookups returning an out-dated pointer (e.g. into fromspace). This bug was uncovered first by examining an occasional failure in Rakudo when compiling constant.t, but could have affected various constructs taking similar paths through the parser.
- Loading branch information...