mirror of
https://github.com/SerenityOS/serenity
synced 2024-10-15 12:23:15 +00:00
LibWasm: Fix reference-to-stack-local from {Memory,Table}Instance
Allocating a MemoryInstance or TableInstance from Store would result in a reference to a stack allocated {Memory,Table}Type that would immediately fall out of scope. The MemoryInstance case was causing ASAN issues for a LibWeb based test - I don't have a reproducer for TableInstance, but it looks like it suffers from the exact same problem.
This commit is contained in:
parent
d725076c7f
commit
7abedd2fed
|
@ -399,7 +399,7 @@ public:
|
|||
|
||||
private:
|
||||
Vector<Optional<Reference>> m_elements;
|
||||
TableType const& m_type;
|
||||
TableType m_type;
|
||||
};
|
||||
|
||||
class MemoryInstance {
|
||||
|
@ -459,7 +459,7 @@ private:
|
|||
{
|
||||
}
|
||||
|
||||
MemoryType const& m_type;
|
||||
MemoryType m_type;
|
||||
size_t m_size { 0 };
|
||||
ByteBuffer m_data;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue