Unified · Split
| @@ -1826,7 +1826,10 @@ ST_FUNC void gen_vla_sp_save(int addr) { · 1825 unmodified lines | ||
| 1826 | 1826 | } |
| 1827 | 1827 | |
| 1828 | 1828 | ST_FUNC void gen_vla_sp_restore(int addr) { |
| 1829 | − uint32_t r = intr(get_reg(RC_INT)); | |
| 1829 | + // Use x30 because this function can be called when there | |
| 1830 | + // is a live return value in x0 but there is nothing on | |
| 1831 | + // the value stack to prevent get_reg from returning x0. | |
| 1832 | + uint32_t r = 30; | |
| 1830 | 1833 | arm64_ldrx(0, 3, r, 29, addr); |
| 1831 | 1834 | o(0x9100001f | r << 5); // mov sp,x(r) |
| 1832 | 1835 | } |