Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed a bug in FLEncoder_LastValueWritten, FLEncoder_Snip, FLEncoder_WriteValueAgain #184

Closed
wants to merge 1 commit into from

Conversation

snej
Copy link
Contributor

@snej snej commented Jul 10, 2023

The internal enum type Encoder::PreWrittenValue had a badly-chosen "none" value of 0, which could easily occur as a valid value.

This meant Encoder::lastValueWritten() would return a false negative if the last value written was the first value (at offset 0.)

This in turn meant Encoder::snip() would return nullslice in this case.

This in turn broke LiteCore's VectorRecord.

This fix shouldn't affect anything, since these API calls are only used by LiteCore's version vector code, which is still disabled.

…WriteValueAgain

The internal enum type Encoder::PreWrittenValue had a badly-chosen
"none" value of 0, which could easily occur as a valid value.

This meant Encoder::lastValueWritten() would return a false negative
if the last value written was the first value (at offset 0.)

This in turn meant Encoder::snip() would return nullslice in this
case.

This in turn broke LiteCore's VectorRecord in this case.
@snej snej closed this Jul 19, 2023
@snej snej deleted the fix/encoder_snip branch July 19, 2023 19:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant