Branch: Tag:

2021-03-23

2021-03-23 16:39:36 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Compiler [Typechecker]: Improved typechecking of assignments.

The checker is now informed that void values are converted into
UNDEFINED/zero on assignment.

Fixes several warnings.

3700:    /* This test isn't sufficient, see below. */    check_node_type(CDR(n), CAR(n)->type, "Bad type in assignment.");   #else /* !0 */ -  if (!pike_types_le(CDR(n)->type, CAR(n)->type, 0, 0)) { +  if (!pike_types_le(CDR(n)->type, CAR(n)->type, +  PT_FLAG_CMP_VOID_IS_ZERO, 0)) {    /* a["b"]=c and a->b=c can be valid when a is an array.    *    * FIXME: Exactly what case is the problem?
3848:    /* Check that the returned type is compatible with the    * variable type.    */ -  if (!pike_types_le(f, CAR(n)->type, 0, 0)) { +  if (!pike_types_le(f, CAR(n)->type, +  PT_FLAG_CMP_VOID_IS_ZERO, 0)) {    /* a["b"]+=c and a->b+=c can be valid when a is an array.    *    * FIXME: Exactly what case is the problem?