Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/synopse/mORMot
Browse files Browse the repository at this point in the history
Conflicts:
	SynCommons.pas
  • Loading branch information
mariuszmaximus committed Jun 14, 2015
2 parents daf4e11 + 62212d0 commit 488baf9
Show file tree
Hide file tree
Showing 3 changed files with 105 additions and 50 deletions.
11 changes: 7 additions & 4 deletions SQLite3/mORMot.pas
Expand Up @@ -17388,11 +17388,13 @@ procedure TSQLPropInfo.GetJSONValues(Instance: TObject; W: TJSONSerializer);
if wasString then begin
W.Add('"');
if PtrUInt(tmp)<>0 then
W.AddJSONEscape(pointer(tmp),PInteger(PtrUInt(tmp)-4)^);
W.AddJSONEscape(pointer(tmp),
{$ifdef FPC}length(tmp){$else}PInteger(PtrUInt(tmp)-4)^{$endif});
W.Add('"');
end else
if PtrUInt(tmp)<>0 then
W.AddNoJSONEscape(pointer(tmp),PInteger(PtrUInt(tmp)-4)^);
W.AddNoJSONEscape(pointer(tmp),
{$ifdef FPC}length(tmp){$else}PInteger(PtrUInt(tmp)-4)^{$endif});
end;

function TSQLPropInfo.GetValue(Instance: TObject; ToSQL: boolean;
Expand Down Expand Up @@ -18677,7 +18679,8 @@ procedure TSQLPropInfoRTTIRawUTF8.GetJSONValues(Instance: TObject; W: TJSONSeria
W.Add('"');
fPropInfo.GetLongStrProp(Instance,tmp);
if PtrUInt(tmp)<>0 then
W.AddJSONEscape(pointer(tmp),PInteger(PtrUInt(tmp)-4)^);
W.AddJSONEscape(pointer(tmp),
{$ifdef FPC}length(tmp){$else}PInteger(PtrUInt(tmp)-4)^{$endif});
W.Add('"');
end;

Expand Down Expand Up @@ -26143,7 +26146,7 @@ procedure TSQLRecord.FillFrom(const JSONRecord: RawUTF8; FieldBits: PSQLFieldBit
begin
P := pointer(JSONRecord);
if P<>nil then begin
L := PInteger(P-4)^+1; // +1 for last #0
L := {$ifdef FPC}length(JSONRecord){$else}PInteger(P-4)^{$endif}+1; // +1 for last #0
if L<=sizeof(buf) then
tmp := @buf else
getmem(tmp,L);
Expand Down

0 comments on commit 488baf9

Please sign in to comment.