*fixed a wrong comparison bug of member names with the REFLECT statement.

This commit is contained in:
Wang Renxin 2017-10-19 15:06:43 +08:00
parent 8aa2028011
commit 78b4091834
2 changed files with 25 additions and 17 deletions

17
HISTORY
View File

@ -1,3 +1,6 @@
Oct. 19 2017
Fixed a wrong comparison bug of member names with the REFLECT statement
Oct. 17 2017
Added comparison between string and nil
Fixed a multiple disposing bug with retrieved routine object
@ -258,14 +261,14 @@ Added a context parameter to stepped handler
Jun. 23 2016
Added unary negative meta function overriding support for referenced usertype
Fixed a memory leak with variable arguments
Fixed a memory leak with variadic
Jun. 21 2016
Added lambda tracing
Improved error prompting for wrong function reaching
Improved variable argument list processing with lambda
Improved variadic processing with lambda
Improved UTF8 string input/output on Windows for the shell
Fixed a wrong variable argument list processing issue
Fixed a wrong variadic processing issue
Fixed a referenced usertype operation bug
Jun. 17 2016
@ -334,7 +337,7 @@ Added a help option to the shell
Mar. 16 2016
Fixed an execution issue after a lambda
Fixed a cannot RETURN bug from a FOR loop in a sub routine
Fixed a memory leak with referenced data in a variable argument list
Fixed a memory leak with referenced data in variadic
Mar. 15 2016
Improved error prompting of array manipulation
@ -457,7 +460,7 @@ Added an mb_gc function
Added a SET_IMPORTING_DIRS statement to the shell
Added friendly error prompting when memory overflow
Added source file information to stepped handler
Fixed a wrong argument processing bug with variable argument list
Fixed a wrong argument processing bug with variadic
Fixed a wrong hash bug with string object
Fixed a memory corruption bug with importing directory setting
Optimized cached list accessing
@ -488,10 +491,10 @@ Jan. 20 2016
Fixed an unknown type handling bug
Jan. 19 2016
Added support to apply the LEN statement to a variable argument list as LEN(...)
Added support to apply the LEN statement to variadic as LEN(...)
Jan. 18 2016
Added a variable argument list support
Added a variadic support
Added a NOW statement to the shell
Improved shell implementation code

View File

@ -8166,31 +8166,36 @@ static int _reflect_class_field(void* data, void* extra, void* d) {
_var_t* var = 0;
_routine_t* sub = 0;
_dict_t* coll = (_dict_t*)d;
_object_t tmp;
mb_unrefvar(extra);
mb_assert(data && d);
_MAKE_NIL(&tmp);
tmp.type = _DT_STRING;
obj = (_object_t*)data;
if(_is_internal_object(obj))
goto _exit;
switch(obj->type) {
case _DT_VAR:
var = (_var_t*)obj->data.variable;
if(!_ht_find(coll->dict, var->name)) {
mb_value_t kv, vv;
mb_make_string(kv, var->name);
_internal_object_to_public_value(obj, &vv);
_set_dict(coll, &kv, &vv, 0, 0);
tmp.data.string = var->name;
if(!_ht_find(coll->dict, &tmp)) {
mb_value_t key, val;
mb_make_string(key, var->name);
_internal_object_to_public_value(obj, &val);
_set_dict(coll, &key, &val, 0, 0);
}
break;
case _DT_ROUTINE:
sub = (_routine_t*)obj->data.routine;
if(!_ht_find(coll->dict, sub->name)) {
mb_value_t kv, vv;
mb_make_string(kv, sub->name);
mb_make_type(vv, _internal_type_to_public_type(obj->type));
_set_dict(coll, &kv, &vv, 0, 0);
tmp.data.string = sub->name;
if(!_ht_find(coll->dict, &tmp)) {
mb_value_t key, val;
mb_make_string(key, sub->name);
mb_make_type(val, _internal_type_to_public_type(obj->type));
_set_dict(coll, &key, &val, 0, 0);
}
break;