Skip to content

Commit

Permalink
fix bug in call to profiler
Browse files Browse the repository at this point in the history
  • Loading branch information
jackbackrack committed Jan 28, 2025
1 parent 61c650c commit 9ea5e6c
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions compiler/main.stanza
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,12 @@ defn run-with-timing-log<?T> (body:() -> ?T, cmd-args:CommandArgs) -> T :
;If -profile-compiler flag is provided, then execute the body
;with support for profiling.
defn run-with-profiler<?T> (body:() -> ?T, cmd-args:CommandArgs) -> T :
generate<T> :
if flag?(cmd-args, "profile-compiler") :
stack-collapse(profiling({ yield(body()) }, 100), cmd-args["profile-compiler"])
else :
body()
var res:T
if flag?(cmd-args, "profile-compiler") :
stack-collapse(profiling({ res = body() }, 100), cmd-args["profile-compiler"])
else :
res = body()
res

;============================================================
;====================== Verbosity ===========================
Expand Down

0 comments on commit 9ea5e6c

Please sign in to comment.