Merge pull request #43500 from AndreaCatania/gds_fixes
Fixes crash when parse_expression returns nullptr.
This commit is contained in:
commit
d395f70828
1 changed files with 3 additions and 1 deletions
|
@ -184,6 +184,7 @@ void GDScriptParser::push_error(const String &p_message, const Node *p_origin) {
|
||||||
|
|
||||||
#ifdef DEBUG_ENABLED
|
#ifdef DEBUG_ENABLED
|
||||||
void GDScriptParser::push_warning(const Node *p_source, GDScriptWarning::Code p_code, const String &p_symbol1, const String &p_symbol2, const String &p_symbol3, const String &p_symbol4) {
|
void GDScriptParser::push_warning(const Node *p_source, GDScriptWarning::Code p_code, const String &p_symbol1, const String &p_symbol2, const String &p_symbol3, const String &p_symbol4) {
|
||||||
|
ERR_FAIL_COND(p_source == nullptr);
|
||||||
Vector<String> symbols;
|
Vector<String> symbols;
|
||||||
if (!p_symbol1.empty()) {
|
if (!p_symbol1.empty()) {
|
||||||
symbols.push_back(p_symbol1);
|
symbols.push_back(p_symbol1);
|
||||||
|
@ -201,6 +202,7 @@ void GDScriptParser::push_warning(const Node *p_source, GDScriptWarning::Code p_
|
||||||
}
|
}
|
||||||
|
|
||||||
void GDScriptParser::push_warning(const Node *p_source, GDScriptWarning::Code p_code, const Vector<String> &p_symbols) {
|
void GDScriptParser::push_warning(const Node *p_source, GDScriptWarning::Code p_code, const Vector<String> &p_symbols) {
|
||||||
|
ERR_FAIL_COND(p_source == nullptr);
|
||||||
if (is_ignoring_warnings) {
|
if (is_ignoring_warnings) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1419,7 +1421,7 @@ GDScriptParser::Node *GDScriptParser::parse_statement() {
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DEBUG_ENABLED
|
#ifdef DEBUG_ENABLED
|
||||||
if (unreachable) {
|
if (unreachable && result != nullptr) {
|
||||||
current_suite->has_unreachable_code = true;
|
current_suite->has_unreachable_code = true;
|
||||||
if (current_function) {
|
if (current_function) {
|
||||||
push_warning(result, GDScriptWarning::UNREACHABLE_CODE, current_function->identifier->name);
|
push_warning(result, GDScriptWarning::UNREACHABLE_CODE, current_function->identifier->name);
|
||||||
|
|
Loading…
Add table
Reference in a new issue