Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Ghidra/Features/Decompiler/src/decompile/cpp/xml.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2380,13 +2380,14 @@ int4 xml_parse(istream &i,ContentHandler *hand,int4 dbg)
#if YYDEBUG
yydebug = dbg;
#endif
global_scan = new XmlScan(i);
auto scan = make_unique<XmlScan>(i);
global_scan = scan.get(); // raw observer pointer for yyparse / yylex / grammar actions
handler = hand;
handler->startDocument();
int4 res = yyparse();
if (res == 0)
handler->endDocument();
delete global_scan;
global_scan = (XmlScan *)0; // scan goes out of scope below — null the observer first
return res;
}

Expand Down
5 changes: 3 additions & 2 deletions Ghidra/Features/Decompiler/src/decompile/cpp/xml.y
Original file line number Diff line number Diff line change
Expand Up @@ -522,13 +522,14 @@ int4 xml_parse(istream &i,ContentHandler *hand,int4 dbg)
#if YYDEBUG
yydebug = dbg;
#endif
global_scan = new XmlScan(i);
auto scan = make_unique<XmlScan>(i);
global_scan = scan.get(); // raw observer pointer for yyparse / yylex / grammar actions
handler = hand;
handler->startDocument();
int4 res = yyparse();
if (res == 0)
handler->endDocument();
delete global_scan;
global_scan = (XmlScan *)0; // scan goes out of scope below — null the observer first
return res;
}

Expand Down
Loading