Page MenuHomePhabricator

Use size_t for stack index in OP_MULTISIG
ClosedPublic

Authored by deadalnix on Jul 11 2019, 01:26.

Details

Summary

Indices are used to index into the stack and to be compared with the stack size. Even though we don't expect the stack to a billions of elements big, it is correct to use size_t here.

Test Plan
make check
./test/functional/test_runner.py

Diff Detail

Repository
rABC Bitcoin ABC
Branch
size_tmultisig
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 6817
Build 11681: Bitcoin ABC Buildbot (legacy)
Build 11680: arc lint + arc unit

Event Timeline

markblundeberg added inline comments.
src/script/interpreter.cpp
1013

Should k also be a size_t? I had to dig through some C++ standards to convince myself why stacktop(-isig - k) works now, when isig is size_t and k is an int...

src/script/interpreter.cpp
1013

No k iterate through 0 to CScriptNum, which are integers.

This revision is now accepted and ready to land.Jul 13 2019, 01:53
This revision was automatically updated to reflect the committed changes.