Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix segfault on tagged output (#175)
Currently, record_output() segfaults when passed a pointer to a tag. This IR, for example, segfaults on my system: @example = internal constant [3 x i8] c"hi\00" define i64 @kernel() #0 { ... call void @__quantum__rt__tuple_record_output(i64 4, ptr @example) ... This appears to be because record_output() calls CString.from_raw() on a pointer not managed by CString[1]. This commit uses CStr.from_ptr() instead and adds some tests to catch future regressions (hopefully). [1]: https://doc.rust-lang.org/std/ffi/struct.CString.html#method.from_raw Co-authored-by: Stefan J. Wernli <swernli@microsoft.com>
- Loading branch information