Skip to content

Instantly share code, notes, and snippets.

@brson
Created November 10, 2011 19:31
Show Gist options
  • Save brson/1355896 to your computer and use it in GitHub Desktop.
Save brson/1355896 to your computer and use it in GitHub Desktop.
unsafe4leak
define void @_ZN6unsafe4leak17_60978fdbd088de28E(i1*, { i32, { %tydesc*, i1, {} } }*, %tydesc*, i8*) uwtable {
static_allocas:
br label %load_env
load_env: ; preds = %static_allocas
br label %derived_tydescs
derived_tydescs: ; preds = %load_env
br label %dynamic_allocas
dynamic_allocas: ; preds = %derived_tydescs
br label %4
return: ; preds = %4
ret void
; <label>:4 ; preds = %dynamic_allocas
%5 = call i8* @upcall_alloc_c_stack(i32 ptrtoint (i1** getelementptr (i1** null, i32 1) to i32))
%6 = bitcast i8* %5 to { i8* }*
%7 = getelementptr inbounds { i8* }* %6, i32 0, i32 0
store i8* %3, i8** %7
%8 = call i32 @upcall_call_c_stack(i32 ()* @leak, i8* %5)
%9 = trunc i32 %8 to i1
%10 = getelementptr inbounds %tydesc* %2, i32 0, i32 1
%11 = load i32* %10
call void @llvm.memset.p0i8.i32(i8* %3, i8 0, i32 %11, i32 0, i1 false)
%12 = getelementptr inbounds %tydesc* %2, i32 0, i32 0
%13 = load %tydesc*** %12
%14 = getelementptr inbounds %tydesc* %2, i32 0, i32 4
%15 = load void (i1*, i1*, %tydesc**, i8*)** %14
call void %15(i1* null, i1* null, %tydesc** %13, i8* %3)
br label %return
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment