I have a class that has an integer-based “get_” metamethod (see below). In my device Squirrel code I have an object of this class which invokes the metamethod by calling obj. I get the error “stack overflow, cannot resize stack while in a metamethod”. If I “inline” and access the object directly without invoking the metamethod, then everything works OK, so I know I’m not really running out of stack space.
I saw a few forum messages about this error from 4 years ago. Is it still a bug in Squirrel? How to avoid “cannot resize stack while in a metamethod”?
return blob[offset_ + i];