| 1 |
|
| # The C ABI's Perl-visible ends: the table's address, its version, and the |
| 2 |
|
| # selftest that walks it. |
| 3 |
|
| |
| 4 |
|
| MODULE = Struct::Codec PACKAGE = Struct::Codec |
| 5 |
|
| |
| 6 |
|
| # Unsigned, not IV: where the loader maps this object decides the sign bit, and |
| 7 |
|
| # a 32-bit perl above 0x7fffffff would hand back a negative from PTR2IV. |
| 8 |
|
| UV |
| 9 |
|
| _abi_ptr() |
| 10 |
|
| CODE: |
| 11 |
2 |
▶ | RETVAL = PTR2UV(&SC_ABI); |
Branch: 1 branch
| Branch | True | False | Total |
| RETVAL = PTR2UV(&SC_ABI); |
0 |
2 |
2 |
|
| 12 |
|
| OUTPUT: |
| 13 |
|
| RETVAL |
| 14 |
|
| |
| 15 |
|
| IV |
| 16 |
|
| _abi_version() |
| 17 |
|
| CODE: |
| 18 |
2 |
▶ | RETVAL = SC_ABI.abi_version; |
Branch: 1 branch
| Branch | True | False | Total |
| RETVAL = SC_ABI.abi_version; |
0 |
2 |
2 |
|
| 19 |
|
| OUTPUT: |
| 20 |
|
| RETVAL |
| 21 |
|
| |
| 22 |
|
| # (step, bytes, data): 0 when every entry answered as its declaration says, |
| 23 |
|
| # otherwise the number of the check that did not - so a failure names itself |
| 24 |
|
| # rather than sending somebody to read the whole table. The bytes and the |
| 25 |
|
| # structure the C side built come back too, so a Perl test can compare the |
| 26 |
|
| # table's encoding with the Perl surface's for the same data. |
| 27 |
|
| void |
| 28 |
|
| _abi_selftest() |
| 29 |
|
| PREINIT: |
| 30 |
1 |
| int step = 0; |
| 31 |
1 |
| SV *data = NULL; |
| 32 |
|
| SV *bytes; |
| 33 |
|
| PPCODE: |
| 34 |
1 |
| bytes = sc_abi_selftest(aTHX_ &step, &data); |
| 35 |
1 |
▶ | EXTEND(SP, 3); |
Branch: 1 branch
| Branch | True | False | Total |
| EXTEND(SP, 3); |
0 |
1 |
1 |
|
| 36 |
1 |
| mPUSHi(step); |
| 37 |
1 |
▶ | PUSHs(bytes ? sv_2mortal(bytes) : &PL_sv_undef); |
Branch: 1 branch
| Branch | True | False | Total |
| PUSHs(bytes ? sv_2mortal(bytes) : &PL_sv_undef); |
1 |
0 |
1 |
|
| 38 |
1 |
▶ | PUSHs(data ? sv_2mortal(data) : &PL_sv_undef); |
Branch: 1 branch
| Branch | True | False | Total |
| PUSHs(data ? sv_2mortal(data) : &PL_sv_undef); |
1 |
0 |
1 |
|