mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-27 14:58:46 +00:00
LibWeb: Queue a task to proceed after module map entry finishes fetching
We were doing this synchronously, which was unsafe in that caused us to re-enter the module map entry setting code while iterating over the map's entries. The fix is simply to do what the spec says and queue up a task. This way the processing gets deferred to a later time. To avoid stepping into this problem again, I've also added a reentrancy check in ModuleMap. This fixes a sporadic crash in HTML::ModuleMap::add() caught by ASAN. In particular, this was happening regularly on https://shopify.com/
This commit is contained in:
parent
2753075830
commit
e28ac74e0b
Notes:
sideshowbarker
2024-07-16 23:55:09 +09:00
Author: https://github.com/awesomekling
Commit: e28ac74e0b
Pull-request: https://github.com/SerenityOS/serenity/pull/22333
3 changed files with 15 additions and 7 deletions
|
@ -72,6 +72,8 @@ private:
|
|||
|
||||
HashMap<ModuleLocationTuple, Entry> m_values;
|
||||
HashMap<ModuleLocationTuple, Vector<CallbackFunction>> m_callbacks;
|
||||
|
||||
bool m_firing_callbacks { false };
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue