** 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. */
| 234 | ** that is in a register and uses its register index ('ridx') plus one. |
| 235 | */ |
| 236 | static lu_byte reglevel (FuncState *fs, int nvar) { |
| 237 | while (nvar-- > 0) { |
| 238 | Vardesc *vd = getlocalvardesc(fs, nvar); /* get previous variable */ |
| 239 | if (varinreg(vd)) /* is in a register? */ |
| 240 | return cast_byte(vd->vd.ridx + 1); |
| 241 | } |
| 242 | return 0; /* no variables in registers */ |
| 243 | } |
| 244 | |
| 245 | |
| 246 | /* |
no test coverage detected