#1062: Type safe mark alive
----------------------+-----------------------------------------------------
Reporter: NotFound | Owner:
Type: patch | Status: new
Priority: minor | Milestone:
Component: GC | Version: 1.6.0
Severity: low | Keywords:
Lang: | Patch:
Platform: |
----------------------+-----------------------------------------------------
Some weeks ago einstein located a point where a pointer to non-PObj was
used to call Parrot_mark_PObj_alive. Those failures are not catched by the
compiler because in most cases we are marking STRING* and PMC*, and thus
using a casting to PObj.
A solution is to add two new functions, one for PMC and one for STRING,
use that functions in most places and drop the casts. That way most
mistakes will be easily catched by the compilers.
The attached patch does that. In addition the functions allow for NULL and
PMCNULL arguments, shortening the code that uses them.
The real functions are hidden by a macro and are used only in non
optimized builds. In optimized the macro calls Parrot_mark_PObj_alive with
the appropiate typecast and nullness check.
Someone has some objection against that?
--
Ticket URL: <https://trac.parrot.org/parrot/ticket/1062>
Parrot <https://trac.parrot.org/parrot/>
Parrot Development
_______________________________________________
parrot-tickets mailing list
[email protected]
http://lists.parrot.org/mailman/listinfo/parrot-tickets