Merge pull request #100 from alliedmodders/delete-crash
Mark usage correctly when invoking special natives.
This commit is contained in:
		
						commit
						8436a3ea6c
					
				| @ -4214,7 +4214,10 @@ static void dodelete() | ||||
|   { | ||||
|     pushval(1); | ||||
|     ffcall(map->dtor->target, NULL, 1); | ||||
|     markusage(map->dtor->target, uREAD); | ||||
| 
 | ||||
|     // Only mark usage if we're not skipping codegen.
 | ||||
|     if (sc_status != statSKIP) | ||||
|       markusage(map->dtor->target, uREAD); | ||||
|   } | ||||
| 
 | ||||
|   if (zap) { | ||||
|  | ||||
| @ -1415,7 +1415,9 @@ SC_FUNC void invoke_getter(methodmap_method_t *method) | ||||
|   pushreg(sPRI); | ||||
|   pushval(1); | ||||
|   ffcall(method->getter, NULL, 1); | ||||
|   markusage(method->getter, uREAD); | ||||
| 
 | ||||
|   if (sc_status != statSKIP) | ||||
|     markusage(method->getter, uREAD); | ||||
| } | ||||
| 
 | ||||
| SC_FUNC void invoke_setter(methodmap_method_t *method, int save) | ||||
| @ -1433,5 +1435,7 @@ SC_FUNC void invoke_setter(methodmap_method_t *method, int save) | ||||
|   ffcall(method->setter, NULL, 2); | ||||
|   if (save) | ||||
|     popreg(sPRI); | ||||
|   markusage(method->setter, uREAD); | ||||
| 
 | ||||
|   if (sc_status != statSKIP) | ||||
|     markusage(method->setter, uREAD); | ||||
| } | ||||
|  | ||||
							
								
								
									
										12
									
								
								sourcepawn/compiler/tests/ok-reparse-delete.sp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								sourcepawn/compiler/tests/ok-reparse-delete.sp
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,12 @@ | ||||
| methodmap Handle { | ||||
| 	public native ~Handle(); | ||||
| } | ||||
| 
 | ||||
| stock Crab(Handle h) | ||||
| { | ||||
| 	delete h; | ||||
| } | ||||
| 
 | ||||
| public main() | ||||
| { | ||||
| } | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user