http://www.perlmonks.org?node_id=11111307


in reply to Re^4: Why not perl have raw/native type
in thread Why not perl have raw/native type

You call a sub which is declared as accepting an integer arg - so perl pushes an int value dircectly onto the stack rather than the usual pointer to SV. But if someone in the meantime has redefined foo() to be a sub accepting a normal SV argument, then perl won't just do the wrong thing - it will likely crash with a SEGV, or even be a security hole, when it tries to interpret that integer value as the address of an SV.

Dave.

  • Comment on Re^5: Why not perl have raw/native type

Replies are listed 'Best First'.
Re^6: Why not perl have raw/native type
by LanX (Saint) on Jan 10, 2020 at 22:27 UTC
    That's why I mentioned

    > > And yes I know that subs can be redefined, but change of prototype is also emitting a warning.

    Warnings to Fatals.

    > it will likely crash with a SEGV, or even be a security hole, when it tries to interpret that integer value as the address of an SV.

    I suppose using Inline::C or Inline::CPP is even worse, when it comes to such risks.

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery FootballPerl is like chess, only without the dice