Skip to content

Commit

Permalink
Fix SIGBUS on arm cpu
Browse files Browse the repository at this point in the history
Signed-off-by: Seonghyun Kim <[email protected]>
  • Loading branch information
ksh8281 committed Nov 28, 2023
1 parent 109c3c6 commit ef73747
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/codecache/CodeCacheReaderWriter.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ class CodeCacheWriter {
void put(IntegralType value)
{
ASSERT(isAvailable(sizeof(IntegralType)));
*reinterpret_cast<IntegralType*>(m_buffer + m_index) = value;
memcpy(m_buffer + m_index, &value, sizeof(IntegralType));
m_index += sizeof(IntegralType);
}

Expand Down Expand Up @@ -251,7 +251,8 @@ class CodeCacheReader {
IntegralType get()
{
ASSERT(m_index < m_capacity);
IntegralType value = *(reinterpret_cast<IntegralType*>(m_buffer + m_index));
IntegralType value;
memcpy(&value, m_buffer + m_index, sizeof(IntegralType));
m_index += sizeof(IntegralType);
return value;
}
Expand Down
5 changes: 5 additions & 0 deletions src/parser/ast/CommonASTData.h
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,11 @@ struct ExtendedNodeLOC {
};
size_t index;

ExtendedNodeLOC()
: ExtendedNodeLOC(0, 0, 0)
{
}

ExtendedNodeLOC(size_t line, size_t column, size_t index)
: line(line)
, column(column)
Expand Down

0 comments on commit ef73747

Please sign in to comment.