updated the same literal check in hcl_addliteraltocode()
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
2595e5b35d
commit
c9a96e02f7
15
lib/xchg.c
15
lib/xchg.c
@ -679,16 +679,13 @@ int hcl_addliteraltocode (hcl_t* hcl, hcl_code_t* code, hcl_oop_t obj, hcl_oow_t
|
||||
{
|
||||
tmp = ((hcl_oop_oop_t)code->lit.arr)->slot[i];
|
||||
|
||||
if (tmp == obj)
|
||||
if (tmp == obj || hcl_equalobjs(hcl, obj, tmp))
|
||||
{
|
||||
/* this removes redundancy of symbols, characters, and integers. */
|
||||
if (index) *index = i - lfbase;
|
||||
return 0;
|
||||
}
|
||||
else if (HCL_IS_STRING(hcl, obj) && HCL_IS_STRING(hcl, tmp) && hcl_equalobjs(hcl, obj, tmp))
|
||||
{
|
||||
/* a string object requires equality check. however, the string created to the literal frame
|
||||
* must be made immutable. non-immutable string literals are source of various problems */
|
||||
/* this removes redundancy of symbols, characters, and integers.
|
||||
* a string object requires equality check. however,
|
||||
* the string created to the literal frame
|
||||
* must be made immutable. non-immutable string literals are
|
||||
* source of various problems */
|
||||
if (index) *index = i - lfbase;
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user