rdaly525 / coreir

BSD 3-Clause "New" or "Revised" License
101 stars 24 forks source link

Fix CORENamedTypeToString c-API #982

Closed rsetaluri closed 3 years ago

rsetaluri commented 3 years ago

This change adds a context-managed scratch-pad memory which can be used safely, without risk of a memory leak. The c-API CORENamedTypeToString previously returned a pointer to a temporary, which is unsafe. Instead, we allocate context-managed memory and return a buffer contained there.

See https://github.com/rdaly525/coreir/pull/969.