You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by ma...@apache.org on 2012/07/03 23:45:14 UTC
[lucy-commits] svn commit: r1356973 - in /lucy/branches/0.3: ./ core/Lucy/Object/Hash.c
core/Lucy/Object/VTable.c core/Lucy/Test/Plan/TestBlobType.c
core/Lucy/Test/Plan/TestFullTextType.c
Author: marvin
Date: Tue Jul 3 21:45:13 2012
New Revision: 1356973
URL: http://svn.apache.org/viewvc?rev=1356973&view=rev
Log:
LUCY-238 Fix calls to Load() with NULL invocant.
Modified:
lucy/branches/0.3/ (props changed)
lucy/branches/0.3/core/Lucy/Object/Hash.c
lucy/branches/0.3/core/Lucy/Object/VTable.c
lucy/branches/0.3/core/Lucy/Test/Plan/TestBlobType.c
lucy/branches/0.3/core/Lucy/Test/Plan/TestFullTextType.c
Propchange: lucy/branches/0.3/
------------------------------------------------------------------------------
Merged /lucy/trunk:r1356440
Modified: lucy/branches/0.3/core/Lucy/Object/Hash.c
URL: http://svn.apache.org/viewvc/lucy/branches/0.3/core/Lucy/Object/Hash.c?rev=1356973&r1=1356972&r2=1356973&view=diff
==============================================================================
--- lucy/branches/0.3/core/Lucy/Object/Hash.c (original)
+++ lucy/branches/0.3/core/Lucy/Object/Hash.c Tue Jul 3 21:45:13 2012
@@ -148,7 +148,7 @@ Hash_load(Hash *self, Obj *dump) {
VTable_Get_Name(vtable));
}
else if (load != (Obj_load_t)Hash_load) { // stop inf loop
- return load(NULL, dump);
+ return VTable_Load_Obj(vtable, dump);
}
}
}
Modified: lucy/branches/0.3/core/Lucy/Object/VTable.c
URL: http://svn.apache.org/viewvc/lucy/branches/0.3/core/Lucy/Object/VTable.c?rev=1356973&r1=1356972&r2=1356973&view=diff
==============================================================================
--- lucy/branches/0.3/core/Lucy/Object/VTable.c (original)
+++ lucy/branches/0.3/core/Lucy/Object/VTable.c Tue Jul 3 21:45:13 2012
@@ -219,7 +219,10 @@ VTable_load_obj(VTable *self, Obj *dump)
if (load == Obj_load) {
THROW(ERR, "Abstract method Load() not defined for %o", self->name);
}
- return load(NULL, dump);
+ Obj *invoker = VTable_Make_Obj(self);
+ Obj *loaded = load(invoker, dump);
+ DECREF(invoker);
+ return loaded;
}
static void
Modified: lucy/branches/0.3/core/Lucy/Test/Plan/TestBlobType.c
URL: http://svn.apache.org/viewvc/lucy/branches/0.3/core/Lucy/Test/Plan/TestBlobType.c?rev=1356973&r1=1356972&r2=1356973&view=diff
==============================================================================
--- lucy/branches/0.3/core/Lucy/Test/Plan/TestBlobType.c (original)
+++ lucy/branches/0.3/core/Lucy/Test/Plan/TestBlobType.c Tue Jul 3 21:45:13 2012
@@ -29,7 +29,7 @@ test_Dump_Load_and_Equals(TestBatch *bat
Obj *dump = (Obj*)BlobType_Dump(type);
Obj *clone = Obj_Load(dump, dump);
Obj *another_dump = (Obj*)BlobType_Dump_For_Schema(type);
- BlobType *another_clone = BlobType_load(NULL, another_dump);
+ BlobType *another_clone = BlobType_load(type, another_dump);
TEST_TRUE(batch, BlobType_Equals(type, (Obj*)clone),
"Dump => Load round trip");
Modified: lucy/branches/0.3/core/Lucy/Test/Plan/TestFullTextType.c
URL: http://svn.apache.org/viewvc/lucy/branches/0.3/core/Lucy/Test/Plan/TestFullTextType.c?rev=1356973&r1=1356972&r2=1356973&view=diff
==============================================================================
--- lucy/branches/0.3/core/Lucy/Test/Plan/TestFullTextType.c (original)
+++ lucy/branches/0.3/core/Lucy/Test/Plan/TestFullTextType.c Tue Jul 3 21:45:13 2012
@@ -45,7 +45,7 @@ test_Dump_Load_and_Equals(TestBatch *bat
// (This step is normally performed by Schema_Load() internally.)
Hash_Store_Str((Hash*)another_dump, "analyzer", 8, INCREF(tokenizer));
- FullTextType *another_clone = FullTextType_load(NULL, another_dump);
+ FullTextType *another_clone = FullTextType_load(type, another_dump);
TEST_FALSE(batch, FullTextType_Equals(type, (Obj*)boost_differs),
"Equals() false with different boost");