Mark usage correctly when invoking special natives.

This commit is contained in:
David Anderson 2014-07-17 22:30:13 -07:00
parent 7948755b3b
commit b0e98b16ec
3 changed files with 22 additions and 3 deletions

View File

@ -4214,6 +4214,9 @@ static void dodelete()
{ {
pushval(1); pushval(1);
ffcall(map->dtor->target, NULL, 1); ffcall(map->dtor->target, NULL, 1);
// Only mark usage if we're not skipping codegen.
if (sc_status != statSKIP)
markusage(map->dtor->target, uREAD); markusage(map->dtor->target, uREAD);
} }

View File

@ -1415,6 +1415,8 @@ SC_FUNC void invoke_getter(methodmap_method_t *method)
pushreg(sPRI); pushreg(sPRI);
pushval(1); pushval(1);
ffcall(method->getter, NULL, 1); ffcall(method->getter, NULL, 1);
if (sc_status != statSKIP)
markusage(method->getter, uREAD); markusage(method->getter, uREAD);
} }
@ -1433,5 +1435,7 @@ SC_FUNC void invoke_setter(methodmap_method_t *method, int save)
ffcall(method->setter, NULL, 2); ffcall(method->setter, NULL, 2);
if (save) if (save)
popreg(sPRI); popreg(sPRI);
if (sc_status != statSKIP)
markusage(method->setter, uREAD); markusage(method->setter, uREAD);
} }

View File

@ -0,0 +1,12 @@
methodmap Handle {
public native ~Handle();
}
stock Crab(Handle h)
{
delete h;
}
public main()
{
}