public void pushVarargs(int index, int n) {
        int nParams = closure.prototype.numParams;
        int nVarargs = nArguments - nParams;
        if (nVarargs < 0) nVarargs = 0;
        if (n == -1) {
            n = nVarargs;
            setTop(index + n);
        }
        if (nVarargs > n) nVarargs = n;

        stackCopy(-nArguments + nParams, index, nVarargs);

        int numNils = n - nVarargs;
        if (numNils > 0) {
            stackClear(index + nVarargs, index + n - 1);
        }
    }
This ensures that top is at least as high as index, and that everything from index and up is empty.
@param index
main/src/main/java/cgeo/geocaching/wherigo/kahlua/vm/LuaCallFrame.java