Skip to content

Commit

Permalink
Fixed == that the compiler didn't like
Browse files Browse the repository at this point in the history
  • Loading branch information
Lartu committed Dec 4, 2019
1 parent b40cad5 commit f10b7c0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ldpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1419,10 +1419,10 @@ bool line_like(string model_line, vector<string> & tokens, compiler_state & stat
if(!is_txt_map(tokens[j], state)) return false;
}
else if(model_tokens[i] == "$list"){ //$list is a LIST
if(!variable_type(tokens[j], state).back() == 3) return false;
if(variable_type(tokens[j], state).back() != 3) return false;
}
else if(model_tokens[i] == "$map"){ //$map is a MAP
if(!variable_type(tokens[j], state).back() == 4) return false;
if(variable_type(tokens[j], state).back() != 4) return false;
}
else if(model_tokens[i] == "$scalar-list"){ //$scalar-list is a LIST of scalar values
if(!is_scalar_list(tokens[j], state)) return false;
Expand Down

6 comments on commit f10b7c0

@Lartu
Copy link
Owner Author

@Lartu Lartu commented on f10b7c0 Dec 4, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dgarroDC do you think this may have broken anything? I don't really get how was this working before. The compiler cried that !variable_type(tokens[j], state).back() == 4 is always false because !(bool) == 1 or == 0 and that's never 4.

@dgarroDC
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I'm sorry. It's working fine with your change.

@Lartu
Copy link
Owner Author

@Lartu Lartu commented on f10b7c0 Dec 5, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What did this break? I may have to upload new binaries for 4.4 so I'd like to add that to the changelog.

@dgarroDC
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could write something like get length of myList lol. Hi there, this is not a valid statement but 🤔 i 🤔 don't 🤔 care 🤔 and line_like would return true.

@Lartu
Copy link
Owner Author

@Lartu Lartu commented on f10b7c0 Dec 5, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, that is a problem. Do you by any chance know if these are the only places where this happens? Do you also know by any chance if this was introduced recently? These were the only two instances of this error I could find but I would like to be sure about that.

@dgarroDC
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you by any chance know if these are the only places where this happens?

I think so.

Do you also know by any chance if this was introduced recently?

The bug was introduced in ff1f105.

Please sign in to comment.