Skip to content

Commit

Permalink
Merge pull request #1424 from wbkang/bugfix/unsignedswitch
Browse files Browse the repository at this point in the history
Incorrect handling of types causes a segfault on arm
  • Loading branch information
masatake authored May 31, 2017
2 parents 4146b4e + 4c423b7 commit 2064b8a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion main/parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ extern int defineLanguageKind (const langType language, kindDefinition *def,
return defineKind (LanguageTable [language].kindControlBlock, def, freeKindDef);
}

extern kindDefinition* getLanguageKind (const langType language, char kindIndex)
extern kindDefinition* getLanguageKind (const langType language, signed char kindIndex)
{
kindDefinition* kdef;

Expand Down
3 changes: 2 additions & 1 deletion main/parse.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,9 @@ extern parserDefinition* parserNew (const char* name);
extern bool doesLanguageAllowNullTag (const langType language);
extern bool doesLanguageRequestAutomaticFQTag (const langType language);
extern const char *getLanguageName (const langType language);
/* kindIndex has to be explicitly signed because char is not signed in all platforms. */
extern kindDefinition* getLanguageKindForLetter (const langType language, char kindLetter);
extern kindDefinition* getLanguageKind(const langType language, char kindIndex);
extern kindDefinition* getLanguageKind(const langType language, signed char kindIndex);
extern int defineLanguageKind (const langType language, kindDefinition *def,
freeKindDefFunc freeKindDef);
extern langType getNamedLanguage (const char *const name, size_t len);
Expand Down

0 comments on commit 2064b8a

Please sign in to comment.