mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2024-11-30 07:31:28 +00:00
fix crash when cleaning up functions related to [[accumulate]]
This commit is contained in:
parent
f971f89e1e
commit
237722c0b2
2 changed files with 12 additions and 2 deletions
2
Makefile
2
Makefile
|
@ -149,7 +149,7 @@ ifeq ($(UBSAN),1)
|
|||
endif
|
||||
|
||||
# Strip the binaries when not a debug build
|
||||
ifneq (,$(findstring, -g,$(CXXFLAGS)))
|
||||
ifneq (,$(findstring -g,$(CXXFLAGS)))
|
||||
STRIP := true
|
||||
else
|
||||
STRIP := strip
|
||||
|
|
12
parser.cpp
12
parser.cpp
|
@ -4178,8 +4178,18 @@ static bool parse_function_body(parser_t *parser, ast_value *var)
|
|||
|
||||
enderrfn:
|
||||
(void)!parser_leaveblock(parser);
|
||||
parser->functions.pop_back();
|
||||
|
||||
delete func;
|
||||
|
||||
// Remove |func| from |parser->functions|. It may not actually be at the
|
||||
// back of the vector for accumulated functions.
|
||||
for (auto it = parser->functions.begin(); it != parser->functions.end(); it++) {
|
||||
if (*it == func) {
|
||||
parser->functions.erase(it, it + 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
var->m_constval.vfunc = nullptr;
|
||||
|
||||
enderr:
|
||||
|
|
Loading…
Reference in a new issue