Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于运行过程中当前行的获取问题 #553

Open
Ocean5555 opened this issue Jun 26, 2023 · 0 comments
Open

关于运行过程中当前行的获取问题 #553

Ocean5555 opened this issue Jun 26, 2023 · 0 comments

Comments

@Ocean5555
Copy link

我通过ASMCodeGenerator类的visitLineNumber方法添加了visitMethodInsn来获取当前运行脚本所在行号,但发现了一个问题,在执行while循环的过程中,执行完循环体后,会访问循环体外的下一行2次,然后再回到循环中。虽然不会执行循环体的下一行,但会访问该行,导致获取行号的过程中出现业务上的bug。
例如:
1 while true{
2 print("loop");
3 }
4 print("===")
行号获取顺序:2,4,4,3,2,4,4,3,2,4,4,3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant