Skip to content

Commit fa5c896

Browse files
author
MarcoFalke
committed
Add LIFETIMEBOUND to CScript where needed
1 parent dd097c4 commit fa5c896

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/script/script.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#ifndef BITCOIN_SCRIPT_SCRIPT_H
77
#define BITCOIN_SCRIPT_SCRIPT_H
88

9+
#include <attributes.h>
910
#include <crypto/common.h>
1011
#include <prevector.h>
1112
#include <serialize.h>
@@ -438,23 +439,23 @@ class CScript : public CScriptBase
438439
/** Delete non-existent operator to defend against future introduction */
439440
CScript& operator<<(const CScript& b) = delete;
440441

441-
CScript& operator<<(int64_t b) { return push_int64(b); }
442+
CScript& operator<<(int64_t b) LIFETIMEBOUND { return push_int64(b); }
442443

443-
CScript& operator<<(opcodetype opcode)
444+
CScript& operator<<(opcodetype opcode) LIFETIMEBOUND
444445
{
445446
if (opcode < 0 || opcode > 0xff)
446447
throw std::runtime_error("CScript::operator<<(): invalid opcode");
447448
insert(end(), (unsigned char)opcode);
448449
return *this;
449450
}
450451

451-
CScript& operator<<(const CScriptNum& b)
452+
CScript& operator<<(const CScriptNum& b) LIFETIMEBOUND
452453
{
453454
*this << b.getvch();
454455
return *this;
455456
}
456457

457-
CScript& operator<<(const std::vector<unsigned char>& b)
458+
CScript& operator<<(const std::vector<unsigned char>& b) LIFETIMEBOUND
458459
{
459460
if (b.size() < OP_PUSHDATA1)
460461
{

0 commit comments

Comments
 (0)