SIF icon indicating copy to clipboard operation
SIF copied to clipboard

Continue/break statements and strings problems in CFG generation

Open diegocom opened this issue 5 years ago • 3 comments

I'm trying to generate the CFG of my solidity code. Unfortunately there are some problems with Continue/Break statements inside while loop and with strings handling.

  1. Continue/Break statements point directly to next instruction and not to Start/End point of while.
  2. Strings generate syntax error in .dot rapresentation (the double quote is not escaped)

These are known problems?

diegocom avatar Jan 21 '20 19:01 diegocom

Can you provide the code snippet for us to test through?

chao-peng avatar Jan 30 '20 13:01 chao-peng

Snippet CFG:

contract test{ function testFunction() { uint flag = 1; while(flag != 0){ if(flag == 1){ break; } if(flag == 2){ continue; } } } }

cfg

Snippet string error: contract test{ function testFunction() { uint a = 0; require(a > 0, "error a variable"); } }

diegocom avatar Jan 30 '20 14:01 diegocom

Thank you very much for providing this useful bug report. I will work on these issues.

chao-peng avatar Feb 05 '20 10:02 chao-peng