Skip to content

Commit

Permalink
fix: Specify minimum alignment for ResStringPool_span to fix SIGBUS…
Browse files Browse the repository at this point in the history
… on ARMv7

Apparently, a SIGSEGV is also fixed by that.
  • Loading branch information
oSumAtrIX committed Jul 17, 2024
1 parent fa1b651 commit 8285e73
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions patches/androidfw.patch
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,19 @@ index cae2d0bc16b3..13c5f8fc84e8 100644
#include <binder/TextOutput.h>

#endif
diff --git a/src/base/libs/androidfw/include/androidfw/ResourceTypes.h b/libs/androidfw/include/androidfw/ResourceTypes.h
index 3d66244646d5..2d27c34a9154 100644
--- a/src/base/libs/androidfw/include/androidfw/ResourceTypes.h
+++ b/src/base/libs/androidfw/include/androidfw/ResourceTypes.h
@@ -500,7 +500,7 @@ struct ResStringPool_span

// The range of characters in the string that this span applies to.
uint32_t firstChar, lastChar;
-};
+} __attribute__((__packed__, aligned(1)));

/**
* Convenience class for accessing data in a ResStringPool resource.
diff --git a/src/base/libs/androidfw/include/androidfw/StringPiece.h b/src/base/libs/androidfw/include/androidfw/StringPiece.h
index 921877dc4982..27e27e1c2b94 100644
--- a/src/base/libs/androidfw/include/androidfw/StringPiece.h
Expand Down

0 comments on commit 8285e73

Please sign in to comment.