Skip to content

Document OP_NEXT's use of OPf_SPECIAL in op.h #20611

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

Closed
wolfsage opened this issue Dec 15, 2022 · 6 comments
Closed

Document OP_NEXT's use of OPf_SPECIAL in op.h #20611

wolfsage opened this issue Dec 15, 2022 · 6 comments

Comments

@wolfsage
Copy link
Contributor

See cd97dc8 for its meaning

All ops that use the OPf_SPECIAL flag should be documented in op.h where OPf_SPECIAL is defined. This one is missing and should be pretty easy to add.

@leonerd
Copy link
Contributor

leonerd commented Dec 16, 2022

Hrm; your link shows the code where the flag is tested by pp_next. I've been hunting around for the code which sets it but so far I've come up blank. OP_NEXT doesn't have an opchecker, nor does peep.c have much to do with an OP_NEXT at all.

@leonerd
Copy link
Contributor

leonerd commented Dec 16, 2022

Ah, I see it. It's directly in the parser as a direct consequence of next vs next LABEL:

	|	LOOPEX  /* loop exiting command (goto, last, dump, etc) */
			{ $$ = newOP($LOOPEX, OPf_SPECIAL);
			    PL_hints |= HINT_BLOCK_SCOPE; }
	|	LOOPEX term[operand]
			{ $$ = newLOOPEX($LOOPEX,$operand); }

@iabyn
Copy link
Contributor

iabyn commented Dec 16, 2022 via email

@leonerd
Copy link
Contributor

leonerd commented Dec 16, 2022

Ah interesting. I've never had much luck with rerunning programs in gdb like that because often it gets different memory addresses. But that hint of PERL_HASH_SEED=0 might do the trick.

@leonerd
Copy link
Contributor

leonerd commented Dec 16, 2022

I believe #20614 fixes this now. @wolfsage Can this be closed?

@wolfsage
Copy link
Contributor Author

Yes thank you.

I've never had much luck with rerunning programs in gdb like that because often it gets different memory addresses.

I think that's what https://rr-project.org/ aims to solve?

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

No branches or pull requests

3 participants