fixed possible crash in ce_staticexplorer

This commit is contained in:
Basile Burg 2014-07-05 14:30:28 +02:00
parent a7780320a0
commit f7633760ea
2 changed files with 14 additions and 2 deletions

View File

@ -809,9 +809,11 @@ _preSeq:
if old1.data = tk.data then
addError('keyword is duplicated');
(*
if (old1.kind = ltkOperator) and (tk.kind = ltkOperator) then
if not isPtrOperator(tk.data[1]) then // ident operator [&,*] ident
addError('operator rhs cannot be an operator');
*)
if (old1.kind = ltkNumber) and (tk.kind = ltkNumber) then
addError('symbol or operator expected after number');

View File

@ -198,7 +198,7 @@ var
nme: string;
i: NativeInt;
// recursivively display members, without master categories.
// recursively display members, without master categories.
procedure digMembers(const srcDt: TJsonData; const srcNd: TTreeNode);
var
_memb: TJsonData;
@ -314,6 +314,7 @@ begin
if memb <> nil then for i := 0 to memb.Count-1 do
begin
ndcat := nil;
// categories
ln := new(PInt64);
ln^ := memb.Items[i].GetPath('line').AsInt64;
@ -324,7 +325,8 @@ begin
'class' :ndCat := Tree.Items.AddChildObject(ndClass, nme, ln);
'enum' :ndCat := Tree.Items.AddChildObject(ndEnum, nme, ln);
'function' :ndCat := Tree.Items.AddChildObject(ndFunc, nme, ln);
'import' :ndCat := Tree.Items.AddChildObject(ndImp, nme, ln);
'import', 'static import':
ndCat := Tree.Items.AddChildObject(ndImp, nme, ln);
'interface' :ndCat := Tree.Items.AddChildObject(ndIntf, nme, ln);
'mixin' :ndCat := Tree.Items.AddChildObject(ndMix, nme, ln);
'struct' :ndCat := Tree.Items.AddChildObject(ndStruct, nme, ln);
@ -332,6 +334,14 @@ begin
'variable' :ndCat := Tree.Items.AddChildObject(ndVar, nme, ln);
end;
if ndCat = nil then
begin
{$IFDEF DEBUG}
writeln(memb.Items[i].GetPath('kind').AsString);
{$ENDIF}
continue;
end;
ndCat.Parent.Visible := true;
//recursive