Opened 4 years ago
Closed 4 years ago
#5949 closed defect (fixed)
SimpleModelicaParser does stack overflow on huge arrays
Reported by: | adrpo | Owned by: | sjoelund.se |
---|---|---|---|
Priority: | high | Milestone: | 1.16.0 |
Component: | Parser | Version: | |
Keywords: | Cc: |
Description (last modified by adrpo)
Basically it does diffModelicaFileListings on a file with a *HUGE* diagram annotation.
This needs to be rewritten somehow so that it doesn't blow up the stack:
elseif id==TokenId.LBRACE then (tokens, tree) := scan(tokens, tree, TokenId.LBRACE); (tokens, tree, b) := LA1(tokens, tree, {TokenId.RBRACE}); // Easier than checking First(expression), etc if not b then (tokens, tree) := function_arguments(tokens, tree); end if; (tokens, tree) := scan(tokens, tree, TokenId.RBRACE);
Attachments (1)
Change History (5)
Changed 4 years ago by adrpo
comment:1 Changed 4 years ago by adrpo
comment:2 Changed 4 years ago by adrpo
- Description modified (diff)
comment:3 Changed 4 years ago by adrpo
The problem is that function_arguments is self recursive:
https://github.com/OpenModelica/OpenModelica/blob/master/OMCompiler/Compiler/Parsers/SimpleModelicaParser.mo#L1300
comment:4 Changed 4 years ago by sjoelund.se
- Resolution set to fixed
- Status changed from new to closed
Reported by AKIO NATORI via OpenModelica list.