mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 06:32:30 +02:00
LibJS: Make Executable ref-counted and let instruction iterator co-own it
This ensures that the instruction stream pointed at by the instruction iterator remains valid as long as the iterator exists.
This commit is contained in:
Notes:
sideshowbarker
2024-07-17 08:13:43 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/c14db6ab12
@@ -178,13 +178,15 @@ public:
|
||||
UnrealizedSourceRange source_range() const;
|
||||
RefPtr<SourceCode> source_code() const;
|
||||
|
||||
Executable const* executable() const { return m_executable; }
|
||||
|
||||
private:
|
||||
Instruction const& dereference() const { return *reinterpret_cast<Instruction const*>(m_ptr); }
|
||||
|
||||
u8 const* m_begin { nullptr };
|
||||
u8 const* m_end { nullptr };
|
||||
u8 const* m_ptr { nullptr };
|
||||
Executable const* m_executable { nullptr };
|
||||
RefPtr<Executable const> m_executable;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user