Skip to content

Commit

Permalink
fix segfault with broken conditional commands
Browse files Browse the repository at this point in the history
  • Loading branch information
randomdude999 committed Mar 18, 2024
1 parent e9575dc commit 02f0f4e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/asar/assembleblock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1131,12 +1131,14 @@ void assembleblock(const char * block, int& single_line_for_tracker)
bool cond;
if(!is("for"))
{
if(word[1] == NULL) asar_throw_error(0, error_type_block, error_id_broken_command, word[0], "Missing condition.");
cond = getnum(word[1]);
if (foundlabel && !foundlabel_static && !is("assert")) asar_throw_error(0, error_type_block, error_id_label_in_conditional, word[0]);
}

if (is("for"))
{
if(word[1] == NULL) asar_throw_error(0, error_type_block, error_id_broken_command, word[0], "Missing loop range.");
if(single_line_for_tracker != 1)
{
numif--;
Expand Down

0 comments on commit 02f0f4e

Please sign in to comment.