ghkweon / dwscript

Automatically exported from code.google.com/p/dwscript
0 stars 0 forks source link

Name spaced' units causes AV in TProgramInfo.FindSymbolInUnits #464

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create a TdwsUnit containing . in the name.
2. Call TProgramInfo.FindSymbolInUnits.
3. Access Violation.

What version of the product are you using? On what operating system?
r2511

Please provide any additional information below.

In TProgramInfo.FindSymbolInUnits there should be a check to see if the 
TUnitSymbol.Table=nill. E.g.:

function TProgramInfo.FindSymbolInUnits(AUnitList: TList; const Name: 
UnicodeString): TSymbol;
var
  i: Integer;
  Table: TUnitSymbolTable;
begin
  // Search all units for the symbol
  Result := nil;
  for i := 0 to AUnitList.Count - 1 do
  begin
    Table := TUnitSymbol(AUnitList[i]).Table;
    if (Table = nil) then
      continue;
    Result := Table.FindLocal(Name);
    if Assigned(Result) then
      Break;
  end;
end;

Original issue reported on code.google.com by anders.b...@gmail.com on 15 Apr 2014 at 4:45

GoogleCodeExporter commented 8 years ago
This issue was closed by revision r2516.

Original comment by zar...@gmail.com on 16 Apr 2014 at 3:27