Skip to content

Commit 68a1f3c

Browse files
committed
compiler: fix pretty print crash on wrong parent references
1 parent 9533dd1 commit 68a1f3c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

internal/compiler/llr/pretty_print.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,9 @@ impl<T> Display for DisplayPropertyRef<'_, T> {
211211
}
212212
PropertyReference::InParent { level, parent_reference } => {
213213
for _ in 0..level.get() {
214+
if ctx.parent.is_none() {
215+
return write!(f, "<invalid parent reference>");
216+
}
214217
ctx = ctx.parent.unwrap().ctx;
215218
}
216219
write!(f, "{}", Self(parent_reference, ctx))

0 commit comments

Comments
 (0)