From 8b6e51d54e8afed6b9f3a828080de3aa9eb80818 Mon Sep 17 00:00:00 2001 From: Christopher Haster Date: Wed, 25 Jun 2025 23:49:26 -0500 Subject: [PATCH] Fixed assert with branches in lfs3_file_traverse_ This was modified incorrectly for LFS3_2BONLY. We do actually end up with non-bptr non-data tags here when we encounter btree inner nodes. Code changes: code stack ctx before: 37864 2416 636 after: 37888 (+0.1%) 2416 (+0.0%) 636 (+0.0%) --- lfs3.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lfs3.c b/lfs3.c index 03efd8ab..940b45d8 100644 --- a/lfs3.c +++ b/lfs3.c @@ -14208,9 +14208,7 @@ static int lfs3_file_traverse_(lfs3_t *lfs3, const lfs3_bshrub_t *bshrub, } // decode bptrs - if (tag == LFS3_TAG_DATA) { - bptr->data = data; - } else if (LFS3_IFDEF_2BONLY(false, tag == LFS3_TAG_BLOCK)) { + if (LFS3_IFDEF_2BONLY(false, tag == LFS3_TAG_BLOCK)) { #ifndef LFS3_2BONLY err = lfs3_data_readbptr(lfs3, &data, bptr); @@ -14219,7 +14217,7 @@ static int lfs3_file_traverse_(lfs3_t *lfs3, const lfs3_bshrub_t *bshrub, } #endif } else { - LFS3_UNREACHABLE(); + bptr->data = data; } if (tag_) {