We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c5dd173 commit 2e26caeCopy full SHA for 2e26cae
src/wasm-interpreter.h
@@ -3178,14 +3178,11 @@ class ModuleRunnerBase : public ExpressionRunner<SubType> {
3178
Flow fail = Literal::makeFromInt64(-1, table->indexType);
3179
uint64_t delta = deltaFlow.getSingleValue().getUnsigned();
3180
3181
- if (tableSize + delta < tableSize) {
+ uint64_t newSize;
3182
+ if (std::ckd_add(&newSize, tableSize, delta)) {
3183
return fail;
3184
}
- if (tableSize + delta > table->max) {
3185
- return fail;
3186
- }
3187
- Index newSize = tableSize + delta;
3188
- if (newSize > WebLimitations::MaxTableSize) {
+ if (newSize > table->max || newSize > WebLimitations::MaxTableSize) {
3189
3190
3191
if (!info.interface()->growTable(
0 commit comments