| 3732 | } |
| 3733 | |
| 3734 | int asCReader::AdjustStackPosition(int pos) |
| 3735 | { |
| 3736 | if( pos >= (int)adjustByPos.GetLength() ) |
| 3737 | { |
| 3738 | // It can be higher for primitives allocated on top of highest object variable |
| 3739 | if( adjustByPos.GetLength() ) |
| 3740 | pos += (short)adjustByPos[adjustByPos.GetLength()-1]; |
| 3741 | } |
| 3742 | else if( pos >= 0 ) |
| 3743 | pos += (short)adjustByPos[pos]; |
| 3744 | else if( -pos >= (int)adjustNegativeStackByPos.GetLength() ) |
| 3745 | Error(TXT_INVALID_BYTECODE_d); |
| 3746 | else |
| 3747 | pos += (short)adjustNegativeStackByPos[-pos]; |
| 3748 | |
| 3749 | return pos; |
| 3750 | } |
| 3751 | |
| 3752 | int asCReader::AdjustGetOffset(int offset, asCScriptFunction *func, asDWORD programPos) |
| 3753 | { |