Skip to content
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

FunC incorrectly handles while(false) loops #377

Closed
SpyCheese opened this issue May 19, 2022 · 1 comment
Closed

FunC incorrectly handles while(false) loops #377

SpyCheese opened this issue May 19, 2022 · 1 comment

Comments

@SpyCheese
Copy link
Member

Example:

int main(int x) {
  repeat(2) {
    while (0) {
    }
  }
  return 1;
}

Produces compilation error:

cannot generate code for function `main`:
code.fc:1:1: error: control reaches end of function
  int main(int x) {
@Stephen-DOT1

This comment was marked as spam.

EmelyanenkoK added a commit that referenced this issue Aug 4, 2022
* Don't use IFJMP/IFNOTJMP in inline functions

* Fix incorrect ifelse branch code generation 

#374

* Make generate_code_all clearer

* Don't replace IFJMP with IF in inner blocks in inline functions

* Allow unbalance if/else by using RETALT

* Fix wrong PUSHCONT

* Bugfix in IF code generation for inline functions

* Fix unbalanced if/else

* Bugfix and improvements in code generation

* Fix analyzing while(0) in func

#377

* FunC and Asm.fif: Fix inlining large functions

#375

Co-authored-by: SpyCheese <[email protected]>
EmelyanenkoK added a commit that referenced this issue Aug 4, 2022
* Don't use IFJMP/IFNOTJMP in inline functions

* Fix incorrect ifelse branch code generation 

#374

* Make generate_code_all clearer

* Don't replace IFJMP with IF in inner blocks in inline functions

* Allow unbalance if/else by using RETALT

* Fix wrong PUSHCONT

* Bugfix in IF code generation for inline functions

* Fix unbalanced if/else

* Bugfix and improvements in code generation

* Fix analyzing while(0) in func

#377

* FunC and Asm.fif: Fix inlining large functions

#375

Co-authored-by: SpyCheese <[email protected]>
0XSNCRYPTO added a commit to 0XSNCRYPTO/ton that referenced this issue Aug 26, 2024
* Don't use IFJMP/IFNOTJMP in inline functions

* Fix incorrect ifelse branch code generation 

ton-blockchain/ton#374

* Make generate_code_all clearer

* Don't replace IFJMP with IF in inner blocks in inline functions

* Allow unbalance if/else by using RETALT

* Fix wrong PUSHCONT

* Bugfix in IF code generation for inline functions

* Fix unbalanced if/else

* Bugfix and improvements in code generation

* Fix analyzing while(0) in func

ton-blockchain/ton#377

* FunC and Asm.fif: Fix inlining large functions

ton-blockchain/ton#375

Co-authored-by: SpyCheese <[email protected]>
0XSNCRYPTO added a commit to 0XSNCRYPTO/ton that referenced this issue Aug 26, 2024
* Don't use IFJMP/IFNOTJMP in inline functions

* Fix incorrect ifelse branch code generation 

ton-blockchain/ton#374

* Make generate_code_all clearer

* Don't replace IFJMP with IF in inner blocks in inline functions

* Allow unbalance if/else by using RETALT

* Fix wrong PUSHCONT

* Bugfix in IF code generation for inline functions

* Fix unbalanced if/else

* Bugfix and improvements in code generation

* Fix analyzing while(0) in func

ton-blockchain/ton#377

* FunC and Asm.fif: Fix inlining large functions

ton-blockchain/ton#375

Co-authored-by: SpyCheese <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants
@EmelyanenkoK @SpyCheese @Stephen-DOT1 and others