Page MenuHomePhabricator

Use size_t for stack index in OP_MULTISIG

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



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

Diff Detail

rABC Bitcoin ABC
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

deadalnix created this revision.Jul 11 2019, 01:26
Herald added a reviewer: Restricted Project. · View Herald TranscriptJul 11 2019, 01:26
markblundeberg added inline comments.
1013 ↗(On Diff #10224)

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...

deadalnix added inline comments.Jul 11 2019, 09:43
1013 ↗(On Diff #10224)

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

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