Skip to content

Commit

Permalink
fix NPE in errorhandling.buildErrorList
Browse files Browse the repository at this point in the history
  • Loading branch information
saem committed Jan 21, 2024
1 parent 7bc06c9 commit ba59288
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion compiler/ast/errorhandling.nim
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import
],
compiler/utils/[

Check warning on line 39 in compiler/ast/errorhandling.nim

View workflow job for this annotation

GitHub Actions / Build release binaries (Linux)

imported and not used: 'astrepr' [UnusedImport]

Check failure on line 39 in compiler/ast/errorhandling.nim

View workflow job for this annotation

GitHub Actions / Build release binaries (Linux)

imported and not used: 'astrepr' [UnusedImport]

Check warning on line 39 in compiler/ast/errorhandling.nim

View workflow job for this annotation

GitHub Actions / Build release binaries (macOS)

imported and not used: 'astrepr' [UnusedImport]

Check failure on line 39 in compiler/ast/errorhandling.nim

View workflow job for this annotation

GitHub Actions / Build release binaries (macOS)

imported and not used: 'astrepr' [UnusedImport]
debugutils,
astrepr
],
compiler/front/[
msgs,
Expand Down Expand Up @@ -175,7 +176,8 @@ proc buildErrorList(config: ConfigRef, n: PNode, errs: var seq[PNode]) =
errs.add n
else:
for i in 0..<n.len:
buildErrorList(config, n[i], errs)
if n[i] != nil:
buildErrorList(config, n[i], errs)

iterator walkErrors*(config: ConfigRef; n: PNode): PNode =
## traverses the ast and yields errors from innermost to outermost. this is a
Expand Down

0 comments on commit ba59288

Please sign in to comment.