-
Notifications
You must be signed in to change notification settings - Fork 39
Open
Labels
bugSomething isn't workingSomething isn't workingcompiler/msgsCompiler output and diagnostic subsystem: error and warnig reporting, information, debuggingCompiler output and diagnostic subsystem: error and warnig reporting, information, debugginggood first issueEasy-to-start-with issue requiring no in-depth knowledge or complex implementation.Easy-to-start-with issue requiring no in-depth knowledge or complex implementation.
Description
Specification
When using a constant int that is higher than the length of a constant string (haven't tested arrays as a whole), the compiler crashes instead of giving a meaningful error message.
Example
discard "a"[1]
Actual Output
(Debug compiler)
nim.nim nim
nim.nim handleCmdLine
main.nim mainCommand
main.nim compileToBackend
main.nim commandCompileToC
modules.nim compileProject
modules.nim compileModule
passes.nim processModule
passes.nim processTopLevelStmt
sem.nim myProcess
sem.nim semStmtAndGenerateGenerics nkStmtList 383904 /var/home/chronos/test/main.nim(1, 0)
sempass2.nim trackStmt
sempass2.nim track
msgs.nim handleReport
cli_reporter.nim legacyReportBridge
cli_reporter.nim astDiagToLegacyReport
ast_types.nim len
fatal.nim sysFatal
Error: unhandled exception: field 'sons' is not accessible for type 'TNode' using 'kind = nkStrLit' [FieldDefect]
Expected Output
Either an index defect or an error at compile time.
Error: unhandled exception: index 1 not in 0 .. 0 [IndexDefect]
Possible Solution
Additional Information
References
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingcompiler/msgsCompiler output and diagnostic subsystem: error and warnig reporting, information, debuggingCompiler output and diagnostic subsystem: error and warnig reporting, information, debugginggood first issueEasy-to-start-with issue requiring no in-depth knowledge or complex implementation.Easy-to-start-with issue requiring no in-depth knowledge or complex implementation.