]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
libctf: fix spurious error when rolling back to the first snapshot
authorNick Alcock <nick.alcock@oracle.com>
Fri, 28 Jun 2019 21:11:14 +0000 (22:11 +0100)
committerNick Alcock <nick.alcock@oracle.com>
Mon, 1 Jul 2019 10:05:59 +0000 (11:05 +0100)
commitf57cf0e3e357255959d00626bce5c21396e23212
tree0e2f81c002a172e629089f52ac07364c76c99d65
parentf5e9c9bde04ae52b92027b78c9ca20055f1afb78
libctf: fix spurious error when rolling back to the first snapshot

The first ctf_snapshot called after CTF file creation yields a snapshot
handle that always yields a spurious ECTF_OVERROLLBACK error ("Attempt
to roll back past a ctf_update") on ctf_rollback(), even if ctf_update
has never been called.

The fix is to start with a ctf_snapshot value higher than the zero value
that ctf_snapshot_lu ("last update CTF snapshot value") is initialized
to.

libctf/
* ctf-create.c (ctf_create): Fix off-by-one error.
libctf/ChangeLog
libctf/ctf-create.c