Skip to content

Commit bd6d980

Browse files
committed
Preset parser: Return 0.0 constant on empty rvalue if line is terminated properly.
Crashed on presets with expression lines like "val = ;".
1 parent 8e594bc commit bd6d980

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libprojectM/MilkdropPresetFactory/Parser.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -854,7 +854,7 @@ Expr * Parser::_parse_gen_expr ( std::istream & fs, TreeExpr * tree_expr, Milkd
854854
if (*string == 0)
855855
{
856856
if (PARSE_DEBUG) printf("parse_gen_expr: empty string coupled with terminal (LINE %d) \n", line_count);
857-
if (nullptr == tree_expr && (token==tEOF||token==tEOL))
857+
if (nullptr == tree_expr && (token == tEOF || token == tEOL || token == tSemiColon))
858858
{
859859
// we will get here if we have a completely empty line e.g. "shape_1_per_frame1=shpt ="
860860
// we return 0 because returning NULL would indicate an error

0 commit comments

Comments
 (0)