<html>
<head>
<base href="https://bugs.webkit.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - Parse the entire WebAssembly modules"
href="https://bugs.webkit.org/show_bug.cgi?id=147393#c5">Comment # 5</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - Parse the entire WebAssembly modules"
href="https://bugs.webkit.org/show_bug.cgi?id=147393">bug 147393</a>
from <span class="vcard"><a class="email" href="mailto:ggaren@apple.com" title="Geoffrey Garen <ggaren@apple.com>"> <span class="fn">Geoffrey Garen</span></a>
</span></b>
<pre><span class="quote">> (In reply to <a href="show_bug.cgi?id=147393#c3">comment #3</a>)
> > > Source/JavaScriptCore/wasm/WASMModuleParser.h:60
> > > + JSWASMModule* m_module;
> >
> > You need to do something to prevent m_module from being garbage collected.
>
> Since WASMModuleParser is allocated on the stack, doesn't that prevent
> m_module from being GC'd? Do I need to do something extra to protect it?</span >
In practice, you can probably produce GC safety by allocating WASMModuleParser on the stack. But that's a dangerous thing to do because there's no way to prevent a future coder from moving WASMModuleParser to the heap, and in general, C++ is intentionally agnostic about whether an object was instantiated on the stack or the heap.
I think a better solution is to use Strong<T>.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>