File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -686,7 +686,8 @@ typedef enum
686
686
ECMA_STRING_CONTAINER_UINT32_IN_DESC , /**< actual data is UInt32-represeneted Number
687
687
stored locally in the string's descriptor */
688
688
ECMA_STRING_CONTAINER_MAGIC_STRING , /**< the ecma-string is equal to one of ECMA magic strings */
689
- ECMA_STRING_CONTAINER_MAGIC_STRING_EX /**< the ecma-string is equal to one of external magic strings */
689
+ ECMA_STRING_CONTAINER_MAGIC_STRING_EX , /**< the ecma-string is equal to one of external magic strings */
690
+ ECMA_STRING_CONTAINER__COUNT /** count of container types */
690
691
} ecma_string_container_t ;
691
692
692
693
/**
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 + 1 >= ECMA_STRING_CONTAINER__COUNT ,
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,14 @@ 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 ;
516
+ }
517
+ case ECMA_STRING_CONTAINER__COUNT :
518
+ {
519
+ JERRY_UNREACHABLE ();
509
520
}
510
521
}
511
522
512
-
513
523
ecma_dealloc_string (string_p );
514
524
} /* ecma_deref_ecma_string */
515
525
@@ -565,6 +575,10 @@ ecma_string_to_number (const ecma_string_t *str_p) /**< ecma-string */
565
575
566
576
return num ;
567
577
}
578
+ case ECMA_STRING_CONTAINER__COUNT :
579
+ {
580
+ JERRY_UNREACHABLE ();
581
+ }
568
582
}
569
583
570
584
JERRY_UNREACHABLE ();
You can’t perform that action at this time.
0 commit comments