Skip to content

Commit

Permalink
fixed a bug for --strict-float
Browse files Browse the repository at this point in the history
don't generate any assignment stmt from float to int when --strict-float
is passed.
  • Loading branch information
chenyang78 committed Feb 26, 2020
1 parent 9797ed2 commit 27ace5b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Lhs.cpp
Expand Up @@ -109,6 +109,9 @@ Lhs::make_random(CGContext &cg_context, const Type* t, const CVQualifiers* qfer,
if (!t->is_float() && var->type->is_float()) {
valid = false;
}
if (CGOptions::strict_float() && t->is_float() && !var->type->is_float()) {
valid = false;
}
if (valid) {
assert(var);
Lhs tmp(*var, t, compound_assign);
Expand Down

0 comments on commit 27ace5b

Please sign in to comment.