larryhastings / co_annotations

Other
9 stars 5 forks source link

Account for co_annotations in MAKE_FUNCTION stack_effect(). #13

Closed carljm closed 1 year ago

carljm commented 3 years ago

Just happened to notice this while poking around; given #12 I haven't been able to really verify this fix yet, but I'm pretty sure it's correct. If a MAKE_FUNCTION oparg has the co_annotations flag set, that MAKE_FUNCTION opcode will consume one more element off the stack than it otherwise would, and if this isn't reflected in stack_effect(), it will result in an overestimation of the needed stack size.