Skip to content

Commit

Permalink
Address sanitizer fix for invalid enum.
Browse files Browse the repository at this point in the history
Minor whitespace fixes as well.

Signed-off-by: Michael Sartain <mikesart@gmail.com>
  • Loading branch information
mikesartain authored and brasko committed Jan 13, 2017
1 parent 94829b4 commit ba87c9f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion lib/tgdb/a2-tgdb.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,9 @@ enum annotate_commands {
*
* This functionality was added in gdb in commit 6ff0ba5f.
*/
ANNOTATE_DATA_DISASSEMBLE_MODE_QUERY
ANNOTATE_DATA_DISASSEMBLE_MODE_QUERY,

ANNOTATE_UNUSED = -1
};

/******************************************************************************/
Expand Down
2 changes: 1 addition & 1 deletion lib/tgdb/commands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ struct tgdb_command *tgdb_command_create(const char *gdb_command,

tc = (struct tgdb_command *) cgdb_malloc(sizeof (struct tgdb_command));

tc->gdb_command = gdb_command? strdup(gdb_command) : NULL;
tc->gdb_command = gdb_command ? strdup(gdb_command) : NULL;
tc->command_choice = command_choice;
tc->command = command;

Expand Down
4 changes: 2 additions & 2 deletions lib/tgdb/tgdb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ tgdb_send(struct tgdb *tgdb, const char *command,

/* Create the client command */
tc = tgdb_command_create(command, command_choice,
(enum annotate_commands)-1);
ANNOTATE_UNUSED);

free(temp_command);
temp_command = NULL;
Expand All @@ -661,7 +661,7 @@ tgdb_send(struct tgdb *tgdb, const char *command,
static void
tgdb_run_or_queue_command(struct tgdb *tgdb, struct tgdb_command *command)
{
int can_issue = tgdb_can_issue_command(tgdb);
int can_issue = tgdb_can_issue_command(tgdb);

if (can_issue) {
tgdb_deliver_command(tgdb, command);
Expand Down

0 comments on commit ba87c9f

Please sign in to comment.