develooper Front page | perl.perl5.porters | Postings from August 2018

Request for assistance: PL_top_env and JMPENV

Thread Next
From:
Paul "LeoNerd" Evans
Date:
August 15, 2018 10:26
Subject:
Request for assistance: PL_top_env and JMPENV
Message ID:
20180815112617.290b421a@shy.leonerd.org.uk
Hi all,

I'm continuing to hunt bugs and improve the state of Future-AsyncAwait.
Today I'm running into some confusion around the way that JMPENVs work,
which are used to implement the die() ability across C stacks.

In particular, I have a question about what the PL_top_env variable is
supposed to store. I don't find much documentation about it, but from a
reading of the code, I believe the following statement is an
always-true invariant:

  PL_top_env is always equal to the value of cx->blk_eval.cur_top_env of
  the topmost CXt_EVAL frame (or PL_start_env if such a frame doesn't
  exist)

If that's supposed to be the case, then somewhere in my code I've
managed to break it (because the topmost frame is an CXt_EVAL whose
cur_top_env is not equal to PL_top_env). But having looked it over, I
can't see what I'm doing differently in this case as compared lots of
other CPAN modules, so confusion persists.

My full situation involves die() and eval frames and all sorts of
complication, but before I get into that I'd like first to understand
PL_top_env and the jumpstacks first, to see if my bug is me doing
something silly.

Thanks all,

-- 
Paul "LeoNerd" Evans

leonerd@leonerd.org.uk      |  https://metacpan.org/author/PEVANS
http://www.leonerd.org.uk/  |  https://www.tindie.com/stores/leonerd/

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About