LibJS: Use u32 instead of size_t for bytecode instruction array sizes

Instructions that have an embedded tail array are not going to have
more than 2^32 elements in any remotely sane situation.
This commit is contained in:
Andreas Kling 2025-04-05 23:59:18 +02:00 committed by Andreas Kling
parent 42cc481091
commit 70411a117b
Notes: github-actions[bot] 2025-04-06 00:06:26 +00:00

View file

@ -322,7 +322,7 @@ public:
private:
Operand m_dst;
Operand m_from_object;
size_t m_excluded_names_count { 0 };
u32 m_excluded_names_count { 0 };
Operand m_excluded_names[];
};
@ -367,7 +367,7 @@ public:
private:
Operand m_dst;
size_t m_element_count { 0 };
u32 m_element_count { 0 };
Operand m_elements[];
};
@ -401,7 +401,7 @@ public:
private:
Operand m_dst;
size_t m_element_count { 0 };
u32 m_element_count { 0 };
Value m_elements[];
};
@ -2105,7 +2105,7 @@ private:
Optional<Operand> m_super_class;
ClassExpression const& m_class_expression;
Optional<IdentifierTableIndex> m_lhs_name;
size_t m_element_keys_count { 0 };
u32 m_element_keys_count { 0 };
Optional<Operand> m_element_keys[];
};