Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash on typedef enum with negative hexadecimal #277

Open
mratsim opened this issue Aug 4, 2024 · 0 comments
Open

Crash on typedef enum with negative hexadecimal #277

mratsim opened this issue Aug 4, 2024 · 0 comments

Comments

@mratsim
Copy link

mratsim commented Aug 4, 2024

The following makes c2nim crash

/**
 * @brief Machine code object symbol type.
 */
typedef enum amd_comgr_symbol_type_s {
  /**
   * The symbol's type is unknown.
   *
   * The user should not infer any specific type for symbols which return
   * `AMD_COMGR_SYMBOL_TYPE_UNKNOWN`, and these symbols may return different
   * types in future releases.
  */
  AMD_COMGR_SYMBOL_TYPE_UNKNOWN = -0x1,

  /**
   * The symbol's type is not specified.
  */
  AMD_COMGR_SYMBOL_TYPE_NOTYPE = 0x0,

  /**
   * The symbol is associated with a data object, such as a variable, an array,
   * and so on.
  */
  AMD_COMGR_SYMBOL_TYPE_OBJECT = 0x1,

  /**
   * The symbol is associated with a function or other executable code.
  */
  AMD_COMGR_SYMBOL_TYPE_FUNC = 0x2,

  /**
   * The symbol is associated with a section. Symbol table entries of this type
   * exist primarily for relocation.
  */
  AMD_COMGR_SYMBOL_TYPE_SECTION = 0x3,

  /**
   * Conventionally, the symbol's name gives the name of the source file
   * associated with the object file.
  */
  AMD_COMGR_SYMBOL_TYPE_FILE = 0x4,

  /**
   * The symbol labels an uninitialized common block.
  */
  AMD_COMGR_SYMBOL_TYPE_COMMON = 0x5,

  /**
   * The symbol is associated with an AMDGPU Code Object V2 kernel function.
  */
  AMD_COMGR_SYMBOL_TYPE_AMDGPU_HSA_KERNEL = 0xa
} amd_comgr_symbol_type_t;

with

fatal.nim(53)            sysFatal
Error: unhandled exception: ast.nim(1233, 3) `son != nil`  [AssertionDefect]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant