Changeset - r27443:1150c64644d0
[Not reviewed]
master
0 2 0
Loïc Guilloux - 17 months ago 2023-05-27 16:09:21
glx22@users.noreply.github.com
Fix: Check max member count in squirrel classes (#10883)

Manual cherry-pick from https://github.com/albertodemichelis/squirrel/commit/23a0620658714b996d20da3d4dd1a0dcf9b0bd98
2 files changed with 4 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/3rdparty/squirrel/squirrel/sqclass.cpp
Show inline comments
 
@@ -65,6 +65,9 @@ bool SQClass::NewSlot(SQSharedState *ss,
 
		_defaultvalues[_member_idx(temp)].val = val;
 
		return true;
 
	}
 
	if (_members->CountUsed() >= MEMBER_MAX_COUNT) {
 
		return false;
 
	}
 
	if(type(val) == OT_CLOSURE || type(val) == OT_NATIVECLOSURE || bstatic) {
 
		SQInteger mmidx;
 
		if((type(val) == OT_CLOSURE || type(val) == OT_NATIVECLOSURE) &&
src/3rdparty/squirrel/squirrel/sqclass.h
Show inline comments
 
@@ -19,6 +19,7 @@ typedef sqvector<SQClassMember> SQClassM
 

	
 
#define MEMBER_TYPE_METHOD 0x01000000
 
#define MEMBER_TYPE_FIELD 0x02000000
 
#define MEMBER_MAX_COUNT 0x00FFFFFF
 

	
 
#define _ismethod(o) (_integer(o)&MEMBER_TYPE_METHOD)
 
#define _isfield(o) (_integer(o)&MEMBER_TYPE_FIELD)
0 comments (0 inline, 0 general)