From fe1938484ab359fb76712cb59a43830e6f852f00 Mon Sep 17 00:00:00 2001 From: hop311 Date: Mon, 22 Jan 2024 16:32:18 +0000 Subject: Fixed BasicParser::_file_path relying on externally controlled memory --- src/openvic-dataloader/v2script/Parser.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/openvic-dataloader/v2script') diff --git a/src/openvic-dataloader/v2script/Parser.cpp b/src/openvic-dataloader/v2script/Parser.cpp index c46d326..3141550 100644 --- a/src/openvic-dataloader/v2script/Parser.cpp +++ b/src/openvic-dataloader/v2script/Parser.cpp @@ -273,7 +273,7 @@ const ast::Node::line_col Parser::get_node_end(const ast::NodeCPtr node) const { const ast::Node::line_col ast::Node::get_begin_line_col(const Parser& parser) const { if (!parser._buffer_handler->is_valid() || parser._buffer_handler->_location_map.empty()) return {}; - line_col result; + line_col result {}; auto [itr, range_end] = parser._buffer_handler->_location_map.equal_range(this); if (itr != range_end) { result.line = itr->second.line_nr(); @@ -293,7 +293,7 @@ const ast::Node::line_col ast::Node::get_begin_line_col(const Parser& parser) co const ast::Node::line_col ast::Node::get_end_line_col(const Parser& parser) const { if (!parser._buffer_handler->is_valid() || parser._buffer_handler->_location_map.empty()) return {}; - line_col result; + line_col result {}; auto [itr, range_end] = parser._buffer_handler->_location_map.equal_range(this); if (itr != range_end) { result.line = itr->second.line_nr(); -- cgit v1.2.3-56-ga3b1