** The subtraction of two potentially unrelated pointers is ** not ISO C, but it should not crash a program; the subsequent ** checks are ISO C and ensure a correct result. */
| 654 | ** checks are ISO C and ensure a correct result. |
| 655 | */ |
| 656 | static int isinstack (CallInfo *ci, const TValue *o) { |
| 657 | StkId base = ci->func + 1; |
| 658 | ptrdiff_t i = cast(StkId, o) - base; |
| 659 | return (0 <= i && i < (ci->top - base) && s2v(base + i) == o); |
| 660 | } |
| 661 | |
| 662 | |
| 663 | /* |