lachrist / aran

JavaScript Code Instrumenter
https://lachrist.github.io/aran
MIT License
36 stars 4 forks source link

Erroneous insertion of block-enter trap after label #4

Closed mounty1 closed 5 years ago

mounty1 commented 8 years ago

Given the code

                l = a.split('/');
                c = l.length;
                a: for (;0.0 < c;c -= 1.0){
                    e = (l.slice(0.0,c)).join('/');
                    if (k)for (d = k.length;0.0 < d;d -= 1.0)if (b = m(h,(k.slice(0.0,d)).join('/')))if (b = m(b,e)){
                        f = b;
                        g = c;
                        break a;
                    }
                    (!i && (n && m(n,e))) && (i = m(n,e),p = c);
                }

aran inserts a block-enter trap just after the scope-label a:, which means that the break a statement fails, since its block is no longer labelled.

lachrist commented 8 years ago

Oh right, my assumption about safely duplicating statements is clearly wrong here. Thanks for notifying me, I will fix this as soon as I can.

Cheers, Laurent

On 09 Aug 2016, at 02:38, Michael Mounteney notifications@github.com wrote:

Given the code

            l = a.split('/');
            c = l.length;
            a: for (;0.0 < c;c -= 1.0){
                e = (l.slice(0.0,c)).join('/');
                if (k)for (d = k.length;0.0 < d;d -= 1.0)if (b = m(h,(k.slice(0.0,d)).join('/')))if (b = m(b,e)){
                    f = b;
                    g = c;
                    break a;
                }
                (!i && (n && m(n,e))) && (i = m(n,e),p = c);
            }

aran inserts a block-enter trap just after the scope-label a:, which means that the break a statement fails, since its block is no longer labelled.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/lachrist/aran/issues/4, or mute the thread https://github.com/notifications/unsubscribe-auth/AFNxtb6_AJxYLH_FODQOIfFArVp4WzLfks5qd8wPgaJpZM4JfnIo.