From 70411a117b85cbc15dc5208f8e772858556da0c4 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sat, 5 Apr 2025 23:59:18 +0200 Subject: [PATCH] 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. --- Libraries/LibJS/Bytecode/Op.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Libraries/LibJS/Bytecode/Op.h b/Libraries/LibJS/Bytecode/Op.h index d923ef3744f..834a884be93 100644 --- a/Libraries/LibJS/Bytecode/Op.h +++ b/Libraries/LibJS/Bytecode/Op.h @@ -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 m_super_class; ClassExpression const& m_class_expression; Optional m_lhs_name; - size_t m_element_keys_count { 0 }; + u32 m_element_keys_count { 0 }; Optional m_element_keys[]; };