Skip to content

Commit 06475b2

Browse files
committed
mro.xs mro_set_mro() rmv duplicate PL_stack_base derefs, decrease liveness
1 parent f2aa556 commit 06475b2

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

ext/mro/mro.xs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -425,20 +425,21 @@ mro_set_mro(...)
425425
PROTOTYPE: $$
426426
PREINIT:
427427
SV* classname;
428+
SV* type;
428429
HV* class_stash;
429430
struct mro_meta* meta;
430-
PPCODE:
431+
CODE:
431432
if (items != 2)
432433
croak_xs_usage(cv, "classname, type");
433-
434-
classname = ST(0);
434+
type = POPs;
435+
classname = POPs;
436+
PUTBACK; /* return empty list */
435437
class_stash = gv_stashsv(classname, GV_ADD);
436438
if(!class_stash) Perl_croak_nocontext("Cannot create class: '%" SVf "'!", SVfARG(classname));
437439
meta = HvMROMETA(class_stash);
438440

439-
Perl_mro_set_mro(aTHX_ meta, ST(1));
440-
441-
XSRETURN_EMPTY;
441+
Perl_mro_set_mro(aTHX_ meta, type);
442+
return; /* skip implied PUTBACK; */
442443

443444
void
444445
mro_get_mro(...)

0 commit comments

Comments
 (0)