Skip to content

Commit

Permalink
Backport from satania-buddy
Browse files Browse the repository at this point in the history
  • Loading branch information
Kagamma committed Sep 26, 2023
1 parent 9a24635 commit 145e538
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions ScriptEngine.pas
Original file line number Diff line number Diff line change
Expand Up @@ -870,7 +870,14 @@ class function TBuiltInFunction.SEBufferCreate(const VM: TSEVM; const Args: arra

class function TBuiltInFunction.SEBufferLength(const VM: TSEVM; const Args: array of TSEValue): TSEValue;
begin
Result := SESize(Args[0]);
case Args[0].Kind of
sevkBuffer:
begin
Result := Length(Args[0].VarBuffer^.Base);
end;
else
Result := 0;
end;
end;

class function TBuiltInFunction.SEBufferGetU8(const VM: TSEVM; const Args: array of TSEValue): TSEValue;
Expand Down Expand Up @@ -5351,7 +5358,7 @@ procedure TScriptEngine.Parse;
end;
end;
else
Error(Format('Unknown identify "%s"', [Token.Value]), Token);
Error(Format('Unknown identifier "%s"', [Token.Value]), Token);
end;
end;
end;
Expand Down

0 comments on commit 145e538

Please sign in to comment.