From 27ace5bd643642c20064734343e90da62b54d7fa Mon Sep 17 00:00:00 2001 From: Yang Chen Date: Wed, 26 Feb 2020 14:01:05 -0800 Subject: [PATCH] fixed a bug for --strict-float don't generate any assignment stmt from float to int when --strict-float is passed. --- src/Lhs.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Lhs.cpp b/src/Lhs.cpp index c0085f1b6..62ec8e324 100644 --- a/src/Lhs.cpp +++ b/src/Lhs.cpp @@ -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);