Limit access to the _bufSize, _scriptSize and _heapSize members of the Script class

svn-id: r49327
This commit is contained in:
Filippos Karapetis 2010-05-30 16:14:31 +00:00
parent 0276ec835e
commit c32e88fe0b
10 changed files with 33 additions and 28 deletions

View file

@ -85,7 +85,7 @@ reg_t disassemble(EngineState *s, reg_t pos, int print_bw_tag, int print_bytecod
script_entity = (Script *)mobj;
scr = script_entity->_buf;
scr_size = script_entity->_bufSize;
scr_size = script_entity->getBufSize();
if (pos.offset >= scr_size) {
warning("Trying to disassemble beyond end of script");
@ -303,7 +303,7 @@ void script_debug(EngineState *s) {
if (mobj) {
Script *scr = (Script *)mobj;
byte *code_buf = scr->_buf;
int code_buf_size = scr->_bufSize;
int code_buf_size = scr->getBufSize();
int opcode = scriptState.xs->addr.pc.offset >= code_buf_size ? 0 : code_buf[scriptState.xs->addr.pc.offset];
int op = opcode >> 1;
int paramb1 = scriptState.xs->addr.pc.offset + 1 >= code_buf_size ? 0 : code_buf[scriptState.xs->addr.pc.offset + 1];