We're updating the issue view to help you get more done. 

number_decimfmtprops.cpp has unaligned static memory

Description

The file has the following code:

1 2 3 4 5 char kRawDefaultProperties[sizeof(DecimalFormatProperties)]; ... void U_CALLCONV initDefaultProperties(UErrorCode&) { new(kRawDefaultProperties) DecimalFormatProperties(); }

We have a report that this causes a crash on ARM. The DecimalFormatProperties is being constructed into an unaligned char array, and the DecimalFormatProperties' MeasureUnit field assigns to an int32_t field in its ctor.

Possible fix: add alignas as follows:

1 2 alignas(DecimalFormatProperties) char kRawDefaultProperties[sizeof(DecimalFormatProperties)];

Environment

Status

Assignee

Shane Carr

Reporter

Shane Carr

Components

Fix versions

Priority

critical