Merge pull request #10577 from zielmicha/fix-10568

Fixes #10568: Fix null pointer dereference in address computation for incrSeqV3.
This commit is contained in:
LemonBoy 2019-02-06 14:23:24 +01:00 • committed by GitHub
commit 864c3e874c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1123,7 +1123,7 @@ proc genSeqElemAppend(p: BProc, e: PNode, d: var TLoc) =
# seq = (typeof seq) incrSeq(&seq->Sup, sizeof(x)); # seq = (typeof seq) incrSeq(&seq->Sup, sizeof(x));
# seq->data[seq->len-1] = x; # seq->data[seq->len-1] = x;
let seqAppendPattern = if not p.module.compileToCpp: let seqAppendPattern = if not p.module.compileToCpp:
"($2) #incrSeqV3(&($1)->Sup, $3)" "($2) #incrSeqV3((TGenericSeq*)($1), $3)"
else: else:
"($2) #incrSeqV3($1, $3)" "($2) #incrSeqV3($1, $3)"
var a, b, dest, tmpL, call: TLoc var a, b, dest, tmpL, call: TLoc