** Check whether pointer 'o' points to some value in the stack ** frame of the current function. Because 'o' may not point to a ** value in this stack, we cannot compare it with the region ** boundaries (undefined behaviour in ISO C). */
| 647 | ** boundaries (undefined behaviour in ISO C). |
| 648 | */ |
| 649 | static int isinstack (CallInfo *ci, const TValue *o) { |
| 650 | StkId pos; |
| 651 | for (pos = ci->func + 1; pos < ci->top; pos++) { |
| 652 | if (o == s2v(pos)) |
| 653 | return 1; |
| 654 | } |
| 655 | return 0; /* not found */ |
| 656 | } |
| 657 | |
| 658 | |
| 659 | /* |