File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed
Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -676,6 +676,9 @@ typedef struct
676676
677677/**
678678 * Identifier for ecma-string's actual data container
679+ *
680+ * Important: ECMA_STRING_CONTAINER__MAX must be updated
681+ * below if a new constant is appended to this list
679682 */
680683typedef enum
681684{
@@ -689,6 +692,11 @@ typedef enum
689692 ECMA_STRING_CONTAINER_MAGIC_STRING_EX /**< the ecma-string is equal to one of external magic strings */
690693} ecma_string_container_t ;
691694
695+ /**
696+ * Maximum value of ecma string container types.
697+ */
698+ #define ECMA_STRING_CONTAINER__MAX ECMA_STRING_CONTAINER_MAGIC_STRING_EX
699+
692700/**
693701 * Mask for getting the container of a string.
694702 */
Original file line number Diff line number Diff line change @@ -52,6 +52,12 @@ JERRY_STATIC_ASSERT ((int32_t) ECMA_STRING_MAX_CONCATENATION_LENGTH ==
5252JERRY_STATIC_ASSERT (ECMA_STRING_CONTAINER_MASK + 1 == ECMA_STRING_REF_ONE ,
5353 ecma_string_ref_counter_should_start_after_the_container_field );
5454
55+ /**
56+ * The ecma string container types must be lower than the container mask.
57+ */
58+ JERRY_STATIC_ASSERT (ECMA_STRING_CONTAINER_MASK >= ECMA_STRING_CONTAINER__MAX ,
59+ ecma_string_container_types_must_be_lower_than_the_container_mask );
60+
5561/**
5662 * The ecma string ref and container fields should fill the 16 bit field.
5763 */
@@ -506,10 +512,10 @@ ecma_deref_ecma_string (ecma_string_t *string_p) /**< ecma-string */
506512 case ECMA_STRING_CONTAINER_MAGIC_STRING_EX :
507513 {
508514 /* only the string descriptor itself should be freed */
515+ break ;
509516 }
510517 }
511518
512-
513519 ecma_dealloc_string (string_p );
514520} /* ecma_deref_ecma_string */
515521
You can’t perform that action at this time.
0 commit comments