eval/typval_encode: Make partial conversions not recursive

Is known to crash in the current state.

Ref #5825.
This commit is contained in:
ZyX
2016-12-25 19:37:13 +03:00
parent efe1476d42
commit c5c75513b8
4 changed files with 207 additions and 98 deletions

View File

@@ -357,11 +357,12 @@ void set_option_to(void *to, int type, String name, Object value, Error *err)
#define TYPVAL_ENCODE_CONV_EXT_STRING(str, len, type) \
TYPVAL_ENCODE_CONV_NIL()
#define TYPVAL_ENCODE_CONV_FUNC(fun) \
#define TYPVAL_ENCODE_CONV_FUNC_START(fun, is_partial, pt) \
TYPVAL_ENCODE_CONV_NIL()
#define TYPVAL_ENCODE_CONV_PARTIAL(partial) \
TYPVAL_ENCODE_CONV_NIL()
#define TYPVAL_ENCODE_CONV_FUNC_BEFORE_ARGS(len)
#define TYPVAL_ENCODE_CONV_FUNC_BEFORE_SELF(len)
#define TYPVAL_ENCODE_CONV_FUNC_END()
#define TYPVAL_ENCODE_CONV_EMPTY_LIST() \
kv_push(edata->stack, ARRAY_OBJ(((Array) { .capacity = 0, .size = 0 })))
@@ -484,8 +485,10 @@ TYPVAL_ENCODE_DEFINE_CONV_FUNCTIONS(static, object, EncodedData *const, edata)
#undef TYPVAL_ENCODE_CONV_EXT_STRING
#undef TYPVAL_ENCODE_CONV_NUMBER
#undef TYPVAL_ENCODE_CONV_FLOAT
#undef TYPVAL_ENCODE_CONV_FUNC
#undef TYPVAL_ENCODE_CONV_PARTIAL
#undef TYPVAL_ENCODE_CONV_FUNC_START
#undef TYPVAL_ENCODE_CONV_FUNC_BEFORE_ARGS
#undef TYPVAL_ENCODE_CONV_FUNC_BEFORE_SELF
#undef TYPVAL_ENCODE_CONV_FUNC_END
#undef TYPVAL_ENCODE_CONV_EMPTY_LIST
#undef TYPVAL_ENCODE_CONV_LIST_START
#undef TYPVAL_ENCODE_CONV_EMPTY_DICT