mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Fixes deletion of arguments in pdom.
This commit is contained in:
parent
42cf48b2e8
commit
f7adcb4979
1 changed files with 7 additions and 8 deletions
|
@ -60,27 +60,26 @@ public class PDOMCPPArgumentList {
|
||||||
/**
|
/**
|
||||||
* Restores an array of template arguments from the database.
|
* Restores an array of template arguments from the database.
|
||||||
*/
|
*/
|
||||||
public static void clearArguments(PDOMNode parent, int rec) throws CoreException {
|
public static void clearArguments(PDOMNode parent, final int record) throws CoreException {
|
||||||
final PDOMLinkage linkage= parent.getLinkage();
|
final PDOMLinkage linkage= parent.getLinkage();
|
||||||
final Database db= linkage.getPDOM().getDB();
|
final Database db= linkage.getPDOM().getDB();
|
||||||
final short len= db.getShort(rec);
|
final short len= db.getShort(record);
|
||||||
|
|
||||||
Assert.isTrue(len >= 0 && len <= (Database.MAX_MALLOC_SIZE-2)/8);
|
Assert.isTrue(len >= 0 && len <= (Database.MAX_MALLOC_SIZE-2)/8);
|
||||||
rec+=2;
|
int p= record+2;
|
||||||
for (int i=0; i<len; i++) {
|
for (int i=0; i<len; i++) {
|
||||||
rec++;
|
final int typeRec= db.getInt(p);
|
||||||
final int typeRec= db.getInt(rec);
|
|
||||||
if (typeRec != 0) {
|
if (typeRec != 0) {
|
||||||
final IType t= (IType) linkage.getNode(typeRec);
|
final IType t= (IType) linkage.getNode(typeRec);
|
||||||
linkage.deleteType(t, parent.getRecord());
|
linkage.deleteType(t, parent.getRecord());
|
||||||
}
|
}
|
||||||
final int nonTypeValueRec= db.getInt(rec+4);
|
final int nonTypeValueRec= db.getInt(p+4);
|
||||||
if (nonTypeValueRec != 0) {
|
if (nonTypeValueRec != 0) {
|
||||||
db.getString(nonTypeValueRec).delete();
|
db.getString(nonTypeValueRec).delete();
|
||||||
}
|
}
|
||||||
rec+= 8;
|
p+= 8;
|
||||||
}
|
}
|
||||||
db.free(rec);
|
db.free(record);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue