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

Fix unsupported instruction #105

Merged
merged 9 commits into from
Dec 7, 2022
Merged

Conversation

Rog3rSm1th
Copy link
Member

This PR fixes #103, #89, #83.

It also implements the  dw statements support in the disassembler and the CFG. For example:

func get_data() -> (data: felt*) {
    data_start:
    dw 340282366920938463463374607431768211456;
    dw 1329227995784915872903807060280344576;
    dw 5192296858534827628530496329220096;
    dw 20282409603651670423947251286016;
    dw 79228162514264337593543950336;
    dw 309485009821345068724781056;
    dw 1208925819614629174706176;
    dw 4722366482869645213696;
    dw 18446744073709551616;
    dw 72057594037927936;
    dw 281474976710656;
    dw 1099511627776;
    dw 4294967296;
    dw 16777216;
    dw 65536;
    dw 256;
    dw 1;
}

func main() {
    let (data) = get_data();
    return ();
}

Will be disassembled as:

        func __main__.get_data{}() -> (data : felt*)

LABEL : data_start 
offset 0:          dw 340282366920938463463374607431768211456
offset 1:          dw 1329227995784915872903807060280344576
offset 2:          dw 5192296858534827628530496329220096
offset 3:          dw 20282409603651670423947251286016
offset 4:          dw 79228162514264337593543950336
offset 5:          dw 309485009821345068724781056
offset 6:          dw 1208925819614629174706176
offset 7:          dw 4722366482869645213696
offset 8:          dw 18446744073709551616
offset 9:          dw 72057594037927936
offset 10:         dw 281474976710656  
offset 11:         dw 1099511627776    
offset 12:         dw 4294967296       
offset 13:         dw 16777216         
offset 14:         dw 65536            
offset 15:         dw 256              
offset 16:         dw 1                

        func __main__.main{}()

offset 17:         CALL                0                   # __main__.get_data 
offset 19:         RET                 

@pventuzelo pventuzelo merged commit 3f3101c into master Dec 7, 2022
@Rog3rSm1th Rog3rSm1th deleted the fix_unsupported_instruction branch December 15, 2022 11:26
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

Successfully merging this pull request may close these issues.

Unsupported instruction while trying to print the call graph
2 participants