ponyc icon indicating copy to clipboard operation
ponyc copied to clipboard

LLVM IR verification failure from `with_return` runner test

Open SeanTAllen opened this issue 3 years ago • 1 comments
trafficstars

Terminator found in the middle of a basic block!
label %handler
Error:
Module verification failed: Terminator found in the middle of a basic block!
label %handler

SeanTAllen avatar Feb 23 '22 03:02 SeanTAllen

Problematic IR:

define dso_local void @Main_Dispatch(ptr %0, ptr nocapture readnone %1, ptr nocapture readonly %2) unnamed_addr !pony.abi !2 {
  %4 = getelementptr inbounds { i32, i32, ptr, ptr }, ptr %2, i64 0, i32 3
  %5 = load ptr, ptr %4, align 8
  tail call void @pony_gc_recv(ptr %0)
  tail call void @pony_traceknown(ptr %0, ptr %5, ptr nonnull @15, i32 1)
  tail call void @pony_recv_done(ptr %0)
  %6 = tail call ptr @pony_ctx()
  tail call void @pony_exitcode(i32 10)
  ret void
  ret void
}

where we are doubling ret void from:

actor Main
  new create(env: Env) =>
    with d = Disposble do
      d.set_exit(10)
      return
    end

SeanTAllen avatar Oct 06 '23 18:10 SeanTAllen