Skip to content

Commit

Permalink
Fix range not to include upper limit
Browse files Browse the repository at this point in the history
  • Loading branch information
Smit-create committed Jan 22, 2022
1 parent 6cb3feb commit bb00d25
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/lpython/semantics/python_ast_to_asr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -616,6 +616,11 @@ class BodyVisitor : public CommonVisitor<BodyVisitor> {

ASR::ttype_t *a_type = ASRUtils::TYPE(ASR::make_Integer_t(al, x.base.base.loc,
4, nullptr, 0));
ASR::expr_t *constant_one = ASR::down_cast<ASR::expr_t>(ASR::make_ConstantInteger_t(
al, x.base.base.loc, 1, a_type));
make_BinOp_helper(loop_end, constant_one, ASR::binopType::Sub,
x.base.base.loc, false);
loop_end = ASRUtils::EXPR(tmp);
ASR::do_loop_head_t head;
head.m_v = target;
if (loop_start) {
Expand Down

0 comments on commit bb00d25

Please sign in to comment.