** Convert 'nvar', a compiler index level, to its corresponding ** register. For that, search for the highest variable below that level ** that is in a register and uses its register index ('ridx') plus one. */
| 227 | ** that is in a register and uses its register index ('ridx') plus one. |
| 228 | */ |
| 229 | static int reglevel (FuncState *fs, int nvar) { |
| 230 | while (nvar-- > 0) { |
| 231 | Vardesc *vd = getlocalvardesc(fs, nvar); /* get previous variable */ |
| 232 | if (vd->vd.kind != RDKCTC) /* is in a register? */ |
| 233 | return vd->vd.ridx + 1; |
| 234 | } |
| 235 | return 0; /* no variables in registers */ |
| 236 | } |
| 237 | |
| 238 | |
| 239 | /* |
no test coverage detected