Skip to content

Commit

Permalink
Debug|ACS|Hexen: Error if a script tries to address outside its local…
Browse files Browse the repository at this point in the history
… value stack
  • Loading branch information
danij-deng committed Feb 1, 2014
1 parent 5914238 commit 44f8a2d
Show file tree
Hide file tree
Showing 2 changed files with 185 additions and 177 deletions.
20 changes: 11 additions & 9 deletions doomsday/plugins/hexen/include/acscript.h
Expand Up @@ -49,8 +49,17 @@ typedef struct acscript_s {
int side;
BytecodeScriptInfo *_info;
int delayCount;
int stack[ACS_STACK_DEPTH];
int stackPtr;
struct Stack { // Local value stack.
int values[ACS_STACK_DEPTH];
int height;

#ifdef __cplusplus
void push(int value);
int pop();
int top() const;
void drop();
#endif
} locals;
int vars[MAX_ACS_SCRIPT_VARS];
int const *pcodePtr;

Expand All @@ -70,13 +79,6 @@ typedef struct acscript_s {
* Deserialize the thinker from the currently open save file.
*/
int read(Reader *reader, int mapVersion);

public: /// @todo make private:
void push(int value);
int pop();
int top() const;
void drop();

#endif // __cplusplus
} ACScript;

Expand Down

0 comments on commit 44f8a2d

Please sign in to comment.