Skip to content
This repository was archived by the owner on Dec 23, 2021. It is now read-only.

Commit 6f65a3b

Browse files
committed
HHVM-183: Added explicit cast, as the implicit cast has been removed in HHVM
1 parent 6d4138c commit 6f65a3b

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

bson.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ const StaticString s_MongoDriverBsonODM_fieldName("__pclass");
274274
/* {{{ MongoDriver\BSON\Binary */
275275
void VariantToBsonConverter::_convertBinary(bson_t *bson, const char *key, Object v)
276276
{
277-
String data = v.o_get(s_MongoBsonBinary_data, false, s_MongoBsonBinary_className);
277+
String data = v.o_get(s_MongoBsonBinary_data, false, s_MongoBsonBinary_className).toString();
278278
int64_t type = v.o_get(s_MongoBsonBinary_type, false, s_MongoBsonBinary_className).toInt64();
279279

280280
bson_append_binary(bson, key, -1, (bson_subtype_t) type, (const unsigned char*) data.c_str(), data.length());
@@ -285,7 +285,7 @@ void VariantToBsonConverter::_convertBinary(bson_t *bson, const char *key, Objec
285285
void VariantToBsonConverter::_convertJavascript(bson_t *bson, const char *key, Object v)
286286
{
287287
bson_t *scope_bson;
288-
String code = v.o_get(s_MongoBsonJavascript_code, false, s_MongoBsonJavascript_className);
288+
String code = v.o_get(s_MongoBsonJavascript_code, false, s_MongoBsonJavascript_className).toString();
289289
auto scope = v.o_get(s_MongoBsonJavascript_scope, false, s_MongoBsonJavascript_className);
290290

291291
if (scope.isObject() || scope.isArray()) {
@@ -332,8 +332,8 @@ void VariantToBsonConverter::_convertObjectID(bson_t *bson, const char *key, Obj
332332

333333
void VariantToBsonConverter::_convertRegex(bson_t *bson, const char *key, Object v)
334334
{
335-
String regex = v.o_get(s_MongoBsonRegex_pattern, false, s_MongoBsonRegex_className);
336-
String flags = v.o_get(s_MongoBsonRegex_flags, false, s_MongoBsonRegex_className);
335+
String regex = v.o_get(s_MongoBsonRegex_pattern, false, s_MongoBsonRegex_className).toString();
336+
String flags = v.o_get(s_MongoBsonRegex_flags, false, s_MongoBsonRegex_className).toString();
337337

338338
bson_append_regex(bson, key, -1, regex.c_str(), flags.c_str());
339339
}
@@ -824,7 +824,7 @@ bool BsonToVariantConverter::convert(Variant *v)
824824
if (havePclass) {
825825
String class_name = m_state.zchild[s_MongoDriverBsonODM_fieldName].toObject().o_get(
826826
s_MongoBsonBinary_data, false, s_MongoBsonBinary_className
827-
);
827+
).toString();
828828

829829
/* Lookup class and instantiate object, but if we can't find the class,
830830
* make it a stdClass */
@@ -875,7 +875,7 @@ bool BsonToVariantConverter::convert(Variant *v)
875875

876876
String class_name = m_state.zchild[s_MongoDriverBsonODM_fieldName].toObject().o_get(
877877
s_MongoBsonBinary_data, false, s_MongoBsonBinary_className
878-
);
878+
).toString();
879879
TypedValue args[1] = { *(Variant(m_state.zchild)).asCell() };
880880

881881
/* Lookup class and instantiate object, but if we can't find the class,

0 commit comments

Comments
 (0)