| OLD | NEW |
| 1 From 32a044166e9c02466660549983589bbec39f5752 Mon Sep 17 00:00:00 2001 | 1 From f6f4cb7c2b4055a8683190ad1754b2027c3c522d Mon Sep 17 00:00:00 2001 |
| 2 From: Mike Mammarella <mdm@chromium.org> | 2 From: Mike Mammarella <mdm@chromium.org> |
| 3 Date: Thu, 24 Sep 2009 17:03:24 +0000 | 3 Date: Thu, 24 Sep 2009 17:03:24 +0000 |
| 4 Subject: [PATCH 02/23] Fix expr.c linker error. | 4 Subject: [PATCH 02/16] Fix expr.c linker error. |
| 5 | 5 |
| 6 This can be seen when compiled with a sufficiently optimizing compiler. | 6 This can be seen when compiled with a sufficiently optimizing compiler. |
| 7 | 7 |
| 8 Original review URL: http://codereview.chromium.org/231010 | 8 Original review URL: http://codereview.chromium.org/231010 |
| 9 --- | 9 --- |
| 10 third_party/sqlite/src/src/expr.c | 4 +++- | 10 third_party/sqlite/src/src/expr.c | 4 +++- |
| 11 1 file changed, 3 insertions(+), 1 deletion(-) | 11 1 file changed, 3 insertions(+), 1 deletion(-) |
| 12 | 12 |
| 13 diff --git a/third_party/sqlite/src/src/expr.c b/third_party/sqlite/src/src/expr
.c | 13 diff --git a/third_party/sqlite/src/src/expr.c b/third_party/sqlite/src/src/expr
.c |
| 14 index c0e9ba6..2699ae1 100644 | 14 index 4012f6c..65f211e 100644 |
| 15 --- a/third_party/sqlite/src/src/expr.c | 15 --- a/third_party/sqlite/src/src/expr.c |
| 16 +++ b/third_party/sqlite/src/src/expr.c | 16 +++ b/third_party/sqlite/src/src/expr.c |
| 17 @@ -781,7 +781,9 @@ static Expr *exprDup(sqlite3 *db, Expr *p, int flags, u8 **p
zBuffer){ | 17 @@ -856,7 +856,9 @@ static Expr *exprDup(sqlite3 *db, Expr *p, int flags, u8 **p
zBuffer){ |
| 18 }else{ | 18 }else{ |
| 19 int nSize = exprStructSize(p); | 19 int nSize = exprStructSize(p); |
| 20 memcpy(zAlloc, p, nSize); | 20 memcpy(zAlloc, p, nSize); |
| 21 - memset(&zAlloc[nSize], 0, EXPR_FULLSIZE-nSize); | 21 - memset(&zAlloc[nSize], 0, EXPR_FULLSIZE-nSize); |
| 22 + if( EXPR_FULLSIZE>nSize ){ | 22 + if( EXPR_FULLSIZE>nSize ){ |
| 23 + memset(&zAlloc[nSize], 0, EXPR_FULLSIZE-nSize); | 23 + memset(&zAlloc[nSize], 0, EXPR_FULLSIZE-nSize); |
| 24 + } | 24 + } |
| 25 } | 25 } |
| 26 | 26 |
| 27 /* Set the EP_Reduced, EP_TokenOnly, and EP_Static flags appropriately. *
/ | 27 /* Set the EP_Reduced, EP_TokenOnly, and EP_Static flags appropriately. *
/ |
| 28 -- | 28 -- |
| 29 2.2.1 | 29 2.2.1 |
| 30 | 30 |
| OLD | NEW |