aboutsummaryrefslogtreecommitdiff
path: root/contrib/sqlite3
diff options
context:
space:
mode:
authorCy Schubert <cy@FreeBSD.org>2020-04-23 14:08:40 +0000
committerCy Schubert <cy@FreeBSD.org>2020-04-23 14:08:40 +0000
commit1c2fa9150dab6d3f57f3ad9dacc8cd985bda70ab (patch)
tree7ff76c57d672ebdda43c2dc1ab676ec6c57b6424 /contrib/sqlite3
parent74a6cddade2fbc6ea1144c667834b70016ef9e04 (diff)
Fix PowerPC segfault.
The segfault fix was originally developed by our upstream, sqlite.org, to address S/390 and Sparc segfaults, both of which are big endian. Our PowerPC is also big endian, which this patch also fixes. Reported by: Mark Millard <marklmi at yahoo.com> Tested by: Mark Millard <marklmi at yahoo.com> Obtained from: https://www.sqlite.org/src/vinfo/04885763c4cd00cb?diff=1 https://sqlite.org/forum/forumpost/672291a5b2 MFC after: 1 month X-MFC with: r360221, 360221
Notes
Notes: svn path=/head/; revision=360223
Diffstat (limited to 'contrib/sqlite3')
-rw-r--r--contrib/sqlite3/sqlite3.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/contrib/sqlite3/sqlite3.c b/contrib/sqlite3/sqlite3.c
index 55dc686ee067..0fb0b5593ed6 100644
--- a/contrib/sqlite3/sqlite3.c
+++ b/contrib/sqlite3/sqlite3.c
@@ -121302,12 +121302,14 @@ SQLITE_PRIVATE void sqlite3GenerateConstraintChecks(
x = *sqlite3VdbeGetOp(v, addrConflictCk);
if( x.opcode!=OP_IdxRowid ){
int p2; /* New P2 value for copied conflict check opcode */
+ const char *zP4;
if( sqlite3OpcodeProperty[x.opcode]&OPFLG_JUMP ){
p2 = lblRecheckOk;
}else{
p2 = x.p2;
}
- sqlite3VdbeAddOp4(v, x.opcode, x.p1, p2, x.p3, x.p4.z, x.p4type);
+ zP4 = x.p4type==P4_INT32 ? SQLITE_INT_TO_PTR(x.p4.i) : x.p4.z;
+ sqlite3VdbeAddOp4(v, x.opcode, x.p1, p2, x.p3, zP4, x.p4type);
sqlite3VdbeChangeP5(v, x.p5);
VdbeCoverageIf(v, p2!=x.p2);
}