mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 21:59:07 +00:00
LibCpp: Fix null dereference in IfStatement::declarations()
This commit is contained in:
parent
9288dfced8
commit
68f420ed42
Notes:
sideshowbarker
2024-07-18 20:42:33 +09:00
Author: https://github.com/itamar8910
Commit: 68f420ed42
Pull-request: https://github.com/SerenityOS/serenity/pull/6009
1 changed files with 6 additions and 3 deletions
|
@ -408,9 +408,12 @@ void IfStatement::dump(size_t indent) const
|
||||||
NonnullRefPtrVector<Declaration> IfStatement::declarations() const
|
NonnullRefPtrVector<Declaration> IfStatement::declarations() const
|
||||||
{
|
{
|
||||||
NonnullRefPtrVector<Declaration> declarations;
|
NonnullRefPtrVector<Declaration> declarations;
|
||||||
declarations.append(m_predicate->declarations());
|
if (m_predicate)
|
||||||
declarations.append(m_then->declarations());
|
declarations.append(m_predicate->declarations());
|
||||||
declarations.append(m_else->declarations());
|
if (m_then)
|
||||||
|
declarations.append(m_then->declarations());
|
||||||
|
if (m_else)
|
||||||
|
declarations.append(m_else->declarations());
|
||||||
return declarations;
|
return declarations;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue