Last active
April 16, 2021 21:58
-
-
Save jldodds/faef72d7f5978218c7f07053c185ef52 to your computer and use it in GitHub Desktop.
SAW stack pointers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
void incptr(int* n){ | |
*n = *n+1; | |
} | |
int* return_out_of_scope(){ | |
int n=0; | |
return &n; | |
} | |
int main(){ | |
int* x = return_out_of_scope(); | |
incptr(x); | |
printf("%d\n",*x); | |
return *x; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
m <- llvm_load_module "ptr.bc"; | |
let main_verify= do { | |
llvm_execute_func []; | |
llvm_return (llvm_term {{1 : [32]}}); | |
}; | |
llvm_verify m "main" [] false main_verify abc; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment