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
676
676
677
677
/**
678
678
* 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
679
682
*/
680
683
typedef enum
681
684
{
@@ -689,6 +692,11 @@ typedef enum
689
692
ECMA_STRING_CONTAINER_MAGIC_STRING_EX /**< the ecma-string is equal to one of external magic strings */
690
693
} ecma_string_container_t ;
691
694
695
+ /**
696
+ * Maximum value of ecma string container types.
697
+ */
698
+ #define ECMA_STRING_CONTAINER__MAX ECMA_STRING_CONTAINER_MAGIC_STRING_EX
699
+
692
700
/**
693
701
* Mask for getting the container of a string.
694
702
*/
Original file line number Diff line number Diff line change @@ -52,6 +52,12 @@ JERRY_STATIC_ASSERT ((int32_t) ECMA_STRING_MAX_CONCATENATION_LENGTH ==
52
52
JERRY_STATIC_ASSERT (ECMA_STRING_CONTAINER_MASK + 1 == ECMA_STRING_REF_ONE ,
53
53
ecma_string_ref_counter_should_start_after_the_container_field );
54
54
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
+
55
61
/**
56
62
* The ecma string ref and container fields should fill the 16 bit field.
57
63
*/
@@ -506,10 +512,10 @@ ecma_deref_ecma_string (ecma_string_t *string_p) /**< ecma-string */
506
512
case ECMA_STRING_CONTAINER_MAGIC_STRING_EX :
507
513
{
508
514
/* only the string descriptor itself should be freed */
515
+ break ;
509
516
}
510
517
}
511
518
512
-
513
519
ecma_dealloc_string (string_p );
514
520
} /* ecma_deref_ecma_string */
515
521
You can’t perform that action at this time.
0 commit comments