allscale / allscale_compiler

The AllScale Compiler providing a high-performance, portable implementation of the AllScale API
5 stars 1 forks source link

Invalid transformation for global const variables #10

Closed sithhell closed 6 years ago

sithhell commented 6 years ago

The compiler currently transforms code like this:

namespace { const T t = {...}; }

into code like this:

namespace { const T t; } int IMP_main() { new (&t) T{...}; }

This is undefined and leads to runtime errors since t might be placed in a read only segment of the binary.

destructor64 commented 6 years ago

Fixed with insieme commit https://github.com/insieme/insieme/commit/d78fb2e4cb9f9bd81162426268a818063556a098