aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Pall <mike>2024-08-24 17:11:45 +0200
committerMike Pall <mike>2024-08-24 17:11:45 +0200
commite45fd4cb713b610506213692f3b55a1869febb03 (patch)
treeef6af779679210288635cde7990771a2448c6b56
parent9bb6b35f7fc099ade96951e016c84fc5f3eb41bb (diff)
downloadluajit-e45fd4cb713b610506213692f3b55a1869febb03.tar.gz
luajit-e45fd4cb713b610506213692f3b55a1869febb03.tar.bz2
luajit-e45fd4cb713b610506213692f3b55a1869febb03.zip
Fix limit check in narrow_conv_backprop().
Thanks to Sergey Kaplun. #1262
-rw-r--r--src/lj_opt_narrow.c3
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 }