Skip to content

"For loop" causing infinite loops #1201

Closed

Description

@togekk1

Hi,

I used this "for loop" in my code:
https://github.com/togekk1/simon-cheng/blob/ded2d0354d1dbaebcf3b296674946412deffa44d/src/wasm/assembly/index.ts#L61-L66

When I put it in to comments as the link above shows, the "render" function runs normally.
When I remove the comment marks from only Line 61 and Line 66, "render" function keeps being executed.
But the array "split_by_or" only has 2 items.

Can you help me look into this? Thanks!

Activity

  1. dcodeIO commented on Mar 30, 2020

    @dcodeIO
    Member

    I tried for a couple minutes to get the code snippet running but gave up. No idea what the inputs are supposed to be, but when I throw something random at it it explodes due to accessing arrays out of bounds, which doesn't look like a compiler issue.

    Suggesting to distill this down to something more easily reproducible, removing any code that isn't strictly necessary to trigger the issue.

  2. togekk1 commented on Mar 30, 2020

    @togekk1
    Author

    It turned out that I used the mutable variable "j" twice in Line 40 and Line 61. After rename the latter to "k" everything works now.

    Writing the same code in Javascript it showed the same result. My bad. Closing this issue now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions