|
@@ -100,6 +100,7 @@ uses
|
|
|
constructor Create(afunctype: TWasmFuncType);
|
|
|
procedure add_param(param: TWasmBasicType);
|
|
|
procedure add_result(res: TWasmBasicType);
|
|
|
+ function Equals(Obj: TObject): boolean; override;
|
|
|
end;
|
|
|
|
|
|
{# This should define the array of instructions as string }
|
|
@@ -424,4 +425,25 @@ uses
|
|
|
results[High(results)]:=res;
|
|
|
end;
|
|
|
|
|
|
+ function TWasmFuncType.Equals(Obj: TObject): boolean;
|
|
|
+ var
|
|
|
+ O: TWasmFuncType;
|
|
|
+ begin
|
|
|
+ if Obj=Self then
|
|
|
+ exit(true)
|
|
|
+ else if (Obj<>nil) and (Obj is TWasmFuncType) then
|
|
|
+ begin
|
|
|
+ O:=TWasmFuncType(Obj);
|
|
|
+ if (Length(params)<>Length(O.params)) or (Length(results)<>Length(O.results)) then
|
|
|
+ exit(false);
|
|
|
+ if (Length(params)>0) and (CompareByte(params[0],O.params[0],Length(params)*SizeOf(params[0]))<>0) then
|
|
|
+ exit(false);
|
|
|
+ if (Length(results)>0) and (CompareByte(results[0],O.results[0],Length(results)*SizeOf(results[0]))<>0) then
|
|
|
+ exit(false);
|
|
|
+ Result:=true;
|
|
|
+ end
|
|
|
+ else
|
|
|
+ Result:=inherited Equals(Obj);
|
|
|
+ end;
|
|
|
+
|
|
|
end.
|