From marc at rintsch.de Wed Feb 22 05:32:26 2017 From: marc at rintsch.de (Marc 'BlackJack' Rintsch) Date: Wed Feb 22 05:49:14 2017 Subject: [PEAK] BUILD_CLASS has wrong stack effect Message-ID: <9a229e8d-7f32-e758-d1e7-c4600aabd7b5@rintsch.de> Hi, The stack effect of BUILD_CLASS is given as (3, 0) in the `peak.util.assembler` module, but it is actually (3, 1) as it leaves the newly built class object on the stack. Currently I'm using this monkey patch in my code:: from peak.util.assembler import ( BUILD_CLASS as BUILD_CLASS_OPCODE, Code, stack_effects ) if stack_effects[BUILD_CLASS_OPCODE] == (3, 0): # # Patch in BUILD_CLASS method with correct stack effect. # def BUILD_CLASS(self, op=BUILD_CLASS_OPCODE, se=(3, 1)): self.stackchange(se); self.emit(op) setattr(Code, 'BUILD_CLASS', BUILD_CLASS) Ciao, Marc 'BlackJack' Rintsch -- Calm down. It's only ones and zeros. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: OpenPGP digital signature Url : http://www.eby-sarna.com/pipermail/peak/attachments/20170222/feac3ed4/signature.bin From pje at telecommunity.com Wed Feb 22 11:14:48 2017 From: pje at telecommunity.com (PJ Eby) Date: Wed Feb 22 11:15:15 2017 Subject: [PEAK] BUILD_CLASS has wrong stack effect In-Reply-To: <9a229e8d-7f32-e758-d1e7-c4600aabd7b5@rintsch.de> References: <9a229e8d-7f32-e758-d1e7-c4600aabd7b5@rintsch.de> Message-ID: Fixed and released. Took me several times longer to get a release uploaded than it did to actually make the change; I'm a bit befuddled by all this new, "yeah, documented ways to do things don't work any more, you just have to use this other package to do things that are also not documented" rubbish you have to go through to use PyPI any more. On Wed, Feb 22, 2017 at 5:32 AM, Marc 'BlackJack' Rintsch wrote: > Hi, > > The stack effect of BUILD_CLASS is given as (3, 0) in the > `peak.util.assembler` module, but it is actually (3, 1) as it leaves the > newly built class object on the stack. > > Currently I'm using this monkey patch in my code:: > > from peak.util.assembler import ( > BUILD_CLASS as BUILD_CLASS_OPCODE, Code, stack_effects > ) > > if stack_effects[BUILD_CLASS_OPCODE] == (3, 0): > # > # Patch in BUILD_CLASS method with correct stack effect. > # > def BUILD_CLASS(self, op=BUILD_CLASS_OPCODE, se=(3, 1)): > self.stackchange(se); self.emit(op) > > setattr(Code, 'BUILD_CLASS', BUILD_CLASS) > > Ciao, > Marc 'BlackJack' Rintsch > -- > Calm down. It's only ones and zeros. > > > _______________________________________________ > PEAK mailing list > PEAK@eby-sarna.com > http://www.eby-sarna.com/mailman/listinfo/peak