diff options
| author | Mike Pall <mike> | 2024-08-24 17:11:45 +0200 |
|---|---|---|
| committer | Mike Pall <mike> | 2024-08-24 17:11:45 +0200 |
| commit | e45fd4cb713b610506213692f3b55a1869febb03 (patch) | |
| tree | ef6af779679210288635cde7990771a2448c6b56 /src | |
| parent | 9bb6b35f7fc099ade96951e016c84fc5f3eb41bb (diff) | |
| download | luajit-e45fd4cb713b610506213692f3b55a1869febb03.tar.gz luajit-e45fd4cb713b610506213692f3b55a1869febb03.tar.bz2 luajit-e45fd4cb713b610506213692f3b55a1869febb03.zip | |
Fix limit check in narrow_conv_backprop().
Thanks to Sergey Kaplun. #1262
Diffstat (limited to 'src')
| -rw-r--r-- | src/lj_opt_narrow.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lj_opt_narrow.c b/src/lj_opt_narrow.c index 700c23d4..2f02407c 100644 --- a/src/lj_opt_narrow.c +++ b/src/lj_opt_narrow.c | |||
| @@ -341,7 +341,8 @@ static int narrow_conv_backprop(NarrowConv *nc, IRRef ref, int depth) | |||
| 341 | NarrowIns *savesp = nc->sp; | 341 | NarrowIns *savesp = nc->sp; |
| 342 | int count = narrow_conv_backprop(nc, ir->op1, depth); | 342 | int count = narrow_conv_backprop(nc, ir->op1, depth); |
| 343 | count += narrow_conv_backprop(nc, ir->op2, depth); | 343 | count += narrow_conv_backprop(nc, ir->op2, depth); |
| 344 | if (count <= 1) { /* Limit total number of conversions. */ | 344 | /* Limit total number of conversions. */ |
| 345 | if (count <= 1 && nc->sp < nc->maxsp) { | ||
| 345 | *nc->sp++ = NARROWINS(IRT(ir->o, nc->t), ref); | 346 | *nc->sp++ = NARROWINS(IRT(ir->o, nc->t), ref); |
| 346 | return count; | 347 | return count; |
| 347 | } | 348 | } |
