File tree Expand file tree Collapse file tree 1 file changed +17
-6
lines changed
crates/wasmtime/src/runtime/component/concurrent Expand file tree Collapse file tree 1 file changed +17
-6
lines changed Original file line number Diff line number Diff line change @@ -72,16 +72,27 @@ pub fn set<R>(store: &mut dyn VMStore, f: impl FnOnce() -> R) -> R {
7272pub fn get < R > ( f : impl FnOnce ( & mut dyn VMStore ) -> R ) -> R {
7373 try_get ( |val| match val {
7474 TryGet :: Some ( store) => f ( store) ,
75- TryGet :: None | TryGet :: Taken => get_failed ( ) ,
75+ TryGet :: None => get_failed ( false ) ,
76+ TryGet :: Taken => get_failed ( true ) ,
7677 } )
7778}
7879
7980#[ cold]
80- fn get_failed ( ) -> ! {
81- panic ! (
82- "attempted to recursively call `tls::get` when the pointer was not \
83- present or already taken by a previous call to `tls::get`"
84- ) ;
81+ fn get_failed ( taken : bool ) -> ! {
82+ if taken {
83+ panic ! (
84+ "attempted to recursively call `Accessor::with` when the pointer \
85+ was already taken by a previous call to `Accessor::with`; try \
86+ using `RUST_BACKTRACE=1` to find two stack frames to \
87+ `Accessor::with` on the stack"
88+ ) ;
89+ } else {
90+ panic ! (
91+ "`Accessor::with` was called when the TLS pointer was not \
92+ previously set; this is likely a bug in Wasmtime and we would \
93+ appreciate an issue being filed to help fix this."
94+ ) ;
95+ }
8596}
8697
8798/// Values yielded to the [`try_get`] closure as an argument.
You can’t perform that action at this time.
0 commit comments