-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Emit error when struct is using infinite size #116
Comments
If a struct |
Do you have example code and stuff like logs that lets you know that you used an infinite amount of memory? |
This Flint program currently causes the compiler to segfault: https://github.com/franklinsch/flint/blob/master/examples/invalid/infinite-structs.flint |
So Flint does not support recursive types and should detect & return error on those cases, right? I assume that there will not be data structures like linked-list in Flint, right? |
Yes, at the moment, Flint doesn't support recursive types. They can be supported in the future if needed. For now, an error should be produced. |
I haven't read the code yet so I'd raise a quick question: Do you keep a directed graph of type dependencies? If yes, we could detect loops quickly and abort parsing. |
Such a graph can easily be generated using the information already collected during parsing (represented in Just for context: |
Recommend closing as PR #231 fixed this |
* fix associativity of dot * fix linux not running all tests * fix function calls and variable dereferencing by adding new pass * fix linter errors in EnclosingTypeAssigner * add fix for loop variables * fix property ordering Properties were added to special declaration bodies in a different order to how they were declared. This probably isn't a problem right now, but might be a problem down the line so since I came across it I fixed it. * Revert "fix property ordering" This reverts commit d4917f4. * fix codegen for memory test, same issue as for ForStatement * update comments to be more descriptive * fix pivot op tokens
* [WIP] External traits (#71) * ABNF syntax for external traits * Add external token into Sources/Lexer/Token.swift * Parse new token in Sources/Lexer/Lexer.swift * Extend Sources/Parser/Parser+Declaration.swift (parseTopLevelDeclarations, parseTraitDeclaration) * Add tests to Tests/ParserTests * Change vim plugin to reflect external * Parse if let statements (#69) Parsing if let statements * Parse do-catch statements (#68) * ABNF grammar for do-catch statements * Add tokens do, catch, and is Token.swift * Add parser handling of do ... catch ... * Add tests * address review comments * Address scoping in doCatch * Fix post catch body scoping * Parse external calls (#70) * ABNF grammar for external calls * Adding backticks for consistency * Add call token and parse it in lexer * Add ExternalCall ASTNode * Parse external calls * Moved external trait test to Integration folder * Fix all target in Makefile * Added tests * Remove semicolon from Makefile * Add comment * Change variable name x to paramVisit * Remove unnecessary backticks for non-keywords * Introduce mode enum for external calls * Removed ASTPass.swift generated file * Address style changes for enum members * Prioritise external call on top of binary expression, inside parseExpression * Remove useless type function * Create PR * Add stubs and comments for changes required * Add external call semantic error messages * Add isInsideDo context variable * Add external call type checks * Remove from * Remove requirements reflecting changed proposal * Add stubs and comments for changes required * Add external call semantic error messages * Add isInsideDo context variable * Add external call type checks * Remove from * Remove requirements reflecting changed proposal * Add semantic checks * Merge external call semantic checks * Correct pass context for isInsideDoBlock variable * Move optional type external call variable declaration to BinaryExpression process function * Add accidentally deleted process(functionalCall, ...) function * Improve variable names and comment new error function * Remove isInsideIfCondition context element * Add external call in nested do-catch test * Replace isInsideDoCatch context variable by counter to support nested do-catches * Replace backticks with single quotation marks in error messages * Replace backticks with single quotation marks in test case * added semantic checks for external call hyperparameter types and usage (#106) Added semantic checks for correct hyperparameter types and usages regarding payable and non-payable functions. * Fix dot associativity (#116) * fix associativity of dot * fix linux not running all tests * fix function calls and variable dereferencing by adding new pass * fix linter errors in EnclosingTypeAssigner * add fix for loop variables * fix property ordering Properties were added to special declaration bodies in a different order to how they were declared. This probably isn't a problem right now, but might be a problem down the line so since I came across it I fixed it. * Revert "fix property ordering" This reverts commit d4917f4. * fix codegen for memory test, same issue as for ForStatement * update comments to be more descriptive * fix pivot op tokens * Implement casting parsing (#102) * work in progress – adding parsing for as as? as! * parse as * type conversions parser testing * fix linter issue * add semantic checks for as? as occurrence * wip compat check * add reinterpret checks + tests * add semantic analyzer tests and messages when types cannot be reinterpreted * add isSolidityType * fix tabs * ignore swp * fix external call type resolution and rename x-call flag * preliminary checks and diagnostic message * fix rebase isExternalCall => isExternalFunctionCall * correct ExternalCall visit not passing forward process result * fix type conversion tests * indicate kind when dumping AST of TCX * early return in default case for corrected enclosing type resolution in binary expressions * return true in isComplexStatement for x-calls and tcx * Add stubs and comments for changes required * Add external call semantic error messages * Add isInsideDo context variable * Add external call type checks * Remove from * Remove requirements reflecting changed proposal * Add semantic checks * Merge external call semantic checks * Correct pass context for isInsideDoBlock variable * Move optional type external call variable declaration to BinaryExpression process function * Improve variable names and comment new error function * Remove isInsideIfCondition context element * Add external call in nested do-catch test * Replace isInsideDoCatch context variable by counter to support nested do-catches * Replace backticks with single quotation marks in error messages * Replace backticks with single quotation marks in test case * Rebase * Merge
This is a subtask of #106.
The text was updated successfully, but these errors were encountered: