summaryrefslogtreecommitdiff
path: root/ext/XS-APItest
Commit message (Collapse)AuthorAgeFilesLines
...
* Make SvIsCOW honest about globsFather Chrysostomos2011-07-122-0/+20
| | | | | | | | SvIsCOW was ignoring the fact that it might be passed a typeglob, which made its behaviour contradict its docs. This fixes that and, in doing so, simplifies the upcoming Internals::SvREADONLY fix.
* Increase $XS::APItest::VERSIONFather Chrysostomos2011-07-041-1/+1
|
* Add a test for perl_clone with CLONEf_COPY_STACKS to XS-APItest.Gerard Goossen2011-07-042-0/+108
| | | | | CLONEf_COPY_STACKS is only used by the windows pseudo-fork. This test allows testing/debugging of CLONEf_COPY_STACK without needing threads or Windows.
* Move an XS::APItest var decl to PREINITFather Chrysostomos2011-06-121-1/+2
| | | | Hopefully this will get smoke reports to pass again on Windows.
* Completely free hashes containing nullsFather Chrysostomos2011-06-122-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes a regression introduced since 5.14.0, by commit e0171a1a3. The new Perl_hfree_next_entry function that that commit introduced returns the value of the hash element, or NULL if there are none left. If the value of the hash element is NULL, the two cases are indistin- guishable. Before e0171a1a3, all the hash code took null values into account. mro_package_moved took advantage of that, stealing values out of a hash and leaving it to the freeing code to delete the elements. The two places that call Perl_hfree_next_entry (there was only one, S_hfreeentries, with commit e0171a1a3, but the following commit, 104d7b699c, made sv_clear call it, too) were not accounting for NULL values’ being returned, and could terminate early, resulting in mem- ory leaks. One could argue that the perl core should not be assigning nulls to HeVAL, but HeVAL is part of the public API and there could be CPAN code assigning NULL to it, too. So the safest approach seems to be to modify Perl_hfree_next_entry’s callers to check the number of keys and not to attribute a signifi- cance to a returned NULL.
* Tests for Perl_get_vtbl()Nicholas Clark2011-06-112-0/+49
|
* Warn when list-assigning to TEMPFather Chrysostomos2011-06-011-1/+5
|
* Tests for XS lvalue functionsFather Chrysostomos2011-06-013-1/+43
| | | | | including the ‘Useless assignment to a temporary’ warning which is only triggered by these.
* [perl #87064] eval no longer shares filtersFather Chrysostomos2011-04-033-1/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this commit: commit f07ec6dd59215a56bc1159449a9631be7a02a94d Author: Zefram <zefram@fysh.org> Date: Wed Oct 13 19:05:19 2010 +0100 remove filter inheritance option from lex_start The only uses of lex_start that had the new_filter parameter false, to make the new lexer context share source filters with the previous lexer context, were uses with rsfp null, which therefore never invoked source filters. Inheriting source filters from a logically unrelated file seems like a silly idea anyway. string evals could inherit the same source filter space as the cur- rently compiling code. Despite what the quoted commit message says, sharing source filters allows filters to be inherited in both direc- tions: A source filter created when the eval is being compiled also applies to the file with which it is sharing its space. There are at least 20 CPAN distributions relying on this behaviour (or, rather, what could be considered a Test::More bug). So this com- mit restores the source-filter-sharing capability. It does not change the current API or make public the API for sharing source filters, as this is supposed to be a temporary stop-gap measure for 5.14.
* Convert XS::APItest's svpv_magic.t to Test::More.Nicholas Clark2011-02-051-2/+3
|
* XS-APItest/t/caller.t: mark two passing testsDavid Mitchell2011-01-211-0/+1
| | | | | | | | | | | There are four TODO tests in caller.t, relating to the hints hash returned under the debugger. Since 20439bc77dfeec46d94a15cf108446039e26c995, two of these tests has started to pass. I don't understand this area enough to know whether that commit *should* have made them pass, but it seems fairly consistent. So un-TODO just those two. This means that under the debugger, we now expect to get a hints hash, but that its contents are still wrong.
* Fix typos (spelling errors) in ext/*.Peter J. Acklam) (via RT2011-01-073-4/+4
| | | | | | | | | # New Ticket Created by (Peter J. Acklam) # Please include the string: [perl #81882] # in the subject line of all future correspondence about this issue. # <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=81882 > Signed-off-by: Abigail <abigail@abigail.be>
* bump version of many modulesZefram2010-12-191-1/+1
| | | | | Core-only modules that have changed from v5.13.7, and dual-life modules that have changed from v5.13.7 and didn't show up in earlier passes.
* recursive-descent expression parsingZefram2010-12-113-1/+434
| | | | | | New API functions parse_fullexpr(), parse_listexpr(), parse_termexpr(), and parse_arithexpr(), to parse an expression at various precedence levels.
* fix various compiler warnings from XS codeZefram2010-12-111-7/+24
| | | | | | | | | | | Trivial changes to fix warnings of types * unclear precedence * assignment as conditional * signed/unsigned mixing * unused parameter/variable * value computed not used * wrong argument type for a printf format * variable may be used uninitialised (due to unhandled switch case)
* Fix permissions for ext/XS-APItest/t/refs.t, added as +x in 88b5a879c6c933e0.Nicholas Clark2010-12-111-0/+0
|
* Fix test count in ext/XS-APItest/t/refs.tFather Chrysostomos2010-12-101-1/+1
|
* Fix XS types in typemap in order to deal with references with get magics ↵gfx2010-12-102-0/+64
| | | | correctly
* Add tests for sv_{,un}magicext and mg_findextFlorian Ragwitz2010-11-302-0/+60
|
* %x can't be used directly with pointers.Ben Morrow2010-11-221-4/+4
| | | | | (I keep forgetting this.) Change the four occurrences in the new custom op tests to UVxf with a PTR2UV around the pointer.
* Tests for the new custom op registrations.Ben Morrow2010-11-142-0/+191
|
* Add Perl_bytes_cmp_utf8() to compare character sequences in different encodingsNicholas Clark2010-11-112-0/+45
| | | | | | | | | | | | | | | | | | | | | | | Convert sv_eq_flags() and sv_cmp_flags() to use it. Previously, to compare two strings of characters, where was was in UTF-8, and one was not, you had to either: 1: Upgrade the second to UTF-8 2: Compare the resulting octet sequence 3: Free the temporary UTF-8 string or: 1: Attempt to downgrade the first to bytes. If it can't be, they aren't equal 2: Else compare the resulting octet sequence 3: Free the temporary byte string Which for the general case involves a malloc()/free() and at least two O(n) scans per comparison. Whereas this approach has no allocation, a single O(n) scan, which terminates as early as the best case for the second approach.
* [perl #78964] Fix ext/XS-APItest/t/overload.tJerry D. Hedden2010-11-111-1/+1
| | | | | | | | | Attached patch fixes the following warning from 'make test': ext/XS-APItest/t/overload...................................."my" variable $got masks earlier declaration in same scope at t/overload.t line 81. ok
* Fix error in tryAMAGICunDEREF() introduced in 25a9ffce153b0e67.Nicholas Clark2010-11-092-22/+60
| | | | tryAMAGICunDEREF() isn't used anywhere in the core. Add tests for it.
* G_VOID, G_SCALAR, and G_ARRAY are not separate bits anymoreNiko Tyni2010-11-061-1/+10
| | | | | | | | Commit 2f8edad0d37e91319b6ba10b3745327ea49c179 made G_ARRAY equal to G_SCALAR | G_VOID, contrary to perlcall.pod. Bring the documentation up to date and add a test to prevent a similar (although unlikely) accident in the future.
* Add Perl_amagic_deref_call() to implement the bulk of tryAMAGICunDEREF_var().Nicholas Clark2010-11-032-10/+6
| | | | | | | | | This removes around 300 bytes of object code from each place it was previously inlined. It also provides a better interface - quite a lot of the core currently bodges things by creating a local variable C<SV **sp = &sv> to use the macro. Change the XS::APItest wrapper to amagic_deref_call().
* Add tests for tryAMAGICunDEREF_var().Nicholas Clark2010-11-034-10/+117
|
* add SAVEFREECOPHH()Zefram2010-10-281-1/+3
| | | | | Add the facility for the save stack to free (decrement the refcount of) a COPHH*.
* new API functions op_scope and op_lvalueZefram2010-10-262-12/+96
| | | | | | The function scope() goes into the API as op_scope(), and mod() goes into the API as op_lvalue(). Both marked experimental, because their behaviour is a little quirky and not trivially dequirkable.
* function to parse isolated labelZefram2010-10-255-2/+316
| | | | | | | New API function parse_label() parses a label, separate from statements. If a label has not already been lexed and queued up, it does not use yylex(), but parses the label itself at the character level, to avoid unwanted lexing past an absent optional label.
* function to parse unlabelled statementZefram2010-10-253-3/+57
| | | | | New API function parse_barestmt() parses a pure statement, with no label, and returns just the statement's core ops, not attaching a state op.
* stop passing line numbers into op constructor functionsZefram2010-10-251-12/+4
| | | | | | | | | Remove the line number parameter from newWHILEOP() and newFOROP() functions. Instead, the line number for the impending COP is set by parser code after constructing the ops. (In fact the parser was doing this anyway in most cases.) This brings newWHILEOP() and newFOROP() in line with the other op constructors, in that they do not concern themselves with COPs.
* rt #72398 - get magic before downgrading in SvPVbyte()Tony Cook2010-10-251-3/+0
|
* TODO test: SvPVbyte should handle get magic before checking the utf8 flagNiko Tyni2010-10-252-0/+43
| | | | | | | | | | When $1 had the utf8 flag set from a previous match, SvPVbyte may croak with 'Wide character in subroutine entry' before resetting the flag to its new value. Add a support function and a TODO test for this in XS-APItest. http://bugs.debian.org/376329
* don't rely on ghost contexts being unmolestedZefram2010-10-242-0/+154
| | | | | | | | Dying and returning from a format both relied on the state of a just-popped context frame being preserved across a LEAVE. Don't rely on it. Test using an operator ripped off from Scope::Cleanup, which makes it easy to run arbitrary Perl code during cleanup, without isolating it on a separate context stack as the DESTROY mechanism does.
* Better diagnostics for XS::APItest::test_cv_getset_call_checker().Nicholas Clark2010-10-221-1/+3
|
* Fix ext/XS-APItest/t/multicall.t warningJerry D. Hedden2010-10-211-0/+1
| | | | | | | | | | | 'make test' produces the following warning: ext/XS-APItest/t/multicall.....................................Useless use of private variable in void context at t/multicall.t line 37. ok The attached patch fixes this by adding a "no warnings 'void';" statement to the test file.
* full API for cop hint hashesZefram2010-10-212-14/+144
| | | | | | | | | | | | | Expose cop hint hashes as a type COPHH, with a cophh_* API which is a macro layer over the refcounted_he_* API. The documentation for cophh_* describes purely API-visible behaviour, whereas the refcounted_he_* documentation describes the functions mainly in terms of the implementation. Revise the cop_hints_* API, using the flags parameter consistently and reimplementing in terms of cophh_*. Use the cophh_* and cop_hints_* functions consistently where appropriate. [Modified by the committer to update two calls to Perl_refcounted_he_fetch recently added to newPMOP.]
* function to parse Perl code blockZefram2010-10-214-2/+258
| | | | | New API function parse_block() parses a code block, including surrounding braces. The block is a lexical scope, but not inherently a dynamic scope.
* fix and test PL_expect in recdescent parsingZefram2010-10-214-1/+152
| | | | | Set PL_expect at the start of parse_fullstmt() as well as at the start of parse_stmtseq(). Test both.
* handle bracket stack better in recdescent parsingZefram2010-10-215-3/+209
| | | | | | | | | | | | | When recursing into the parser for recursive-descent parsing, put a special entry on the bracket stack that generates a fake EOF if a closing bracket belonging to an outer parser frame is seen. This keeps the bracket stack balanced across a parse_stmtseq() frame, fixing [perl #78222]. If a recursive-descent parser frame ends by yyunlex()ing an opening bracket, pop its entry off the bracket stack and stash it in the forced-token queue, to be revived when the token is re-lexed. This keeps the bracket stack balanced across a parse_fullstmt() frame.
* avoid side-effecting source held in scalarZefram2010-10-211-0/+12
| | | | | | | | Syntax plugins can modify the source being parsed. It's fine for them to modify the lexer buffer, but this must not be the same scalar that was supplied to lex_start() and may be in use outside. Therefore always copy the scalar in lex_start() rather than just referencing it. Fixes [perl #78358].
* Convert Hash::Util, XS::APItest and XS::Typemap to XSLoader.Nicholas Clark2010-10-211-4/+4
| | | | None are using any DynaLoader specific functionality.
* Recursive MULTICALL prematurely freed CVDavid Mitchell2010-10-191-1/+26
| | | | | | | | See [perl #78070]. Basically, POPSUB/LEAVESUB had a mechanism to decrement the reference count of the CV only at CvDEPTH==1; POP_MULTICALL was decrementing it at all depths.
* add skeleton testing for the MULTICALL macrosDavid Mitchell2010-10-192-0/+63
| | | | | | | | | | | | The macros dMULTICALL, PUSH_MULTICALL, MULTICALL and POP_MULTICALL are completely untested in core apart from incidentally in List-Util. The exercise they get there is probably quite comprehensive, but it's not explicitly testing the macros themselves. Add a hook and new test file to XS::APItest specifically for this purpose. Currently the test file is almost empty. The multicall_each function is shamelessly stolen from List:;Util::first.
* Add LINKLIST to the API.Ben Morrow2010-10-122-2/+118
| | | | | Also rename the underlying function to op_linklist, to match the other API op functions.
* APIify op list constructorsZefram2010-10-122-2/+158
| | | | | | Put into the API op_append_elem, op_prepend_elem, and op_append_list. All renamed from op_-less internal names. Parameter types for op_append_list changed to match the rest of the op API and avoid some casting.
* In APItest.xs, augment croak("fail") with the file name and line number.Nicholas Clark2010-10-121-82/+84
| | | | | | With this, it should be possible to determine which C condition failed without needing to run the test under a debugger. A debugger may still be needed to determine *why*.
* Remove some excess cleverness from the Bhk macros.Ben Morrow2010-10-101-6/+6
| | | | | | | | | Allowing BhkENTRY(bhk, start) to look up the bhk_start member defeats much of the point of having a bhk_ prefix in the first place: if a member is added later called (say) 'bhk_die', any invocation of BhkENTRY(bhk, die) will expand to BhkENTRY(bhk, Perl_die) because of the API macros. Requiring BhkENTRY(bhk, bhk_start), while tedious, is much safer.
* plugin mechanism to rewrite calls to a subroutineZefram2010-10-105-0/+450
| | | | | | | | | | | | | | | | | | | | | | | | New magic type PERL_MAGIC_checkcall attaches a function to a CV, which will be called as the second half of the op checker for an entersub op calling that CV. Default state, in the absence of this magic, is to process the CV's prototype if it has one, or apply list context to all the arguments if not. New API functions cv_get_call_checker() and cv_set_call_checker() provide a clean interface to this facility, hiding the internal use of magic. Expose in the API the new functions rv2cv_op_cv(), ck_entersub_args_list(), ck_entersub_args_proto(), and ck_entersub_args_proto_or_list(), which are meaningful segments of standard entersub op checking and are likely to be useful in plugged-in call checker functions. Expose new API function op_contextualize(), which is a public interface to the internal scalar()/list()/scalarvoid() functions. This API is likely to be required in most plugged-in call checker functions. Incidentally add new function mg_free_type(), in the API, which will remove magic of one type from an SV. (mg_free() removes all magic, and there isn't anything else more selective.)