Skip to content

Commit

Permalink
cloc: don't crash when no arguments given
Browse files Browse the repository at this point in the history
Change-Id: I183577d3c3c5a9f614ed9ab161025376fa5e7ce0
Signed-off-by: Artur Harasimiuk <[email protected]>
  • Loading branch information
ArturHarasimiuk authored and Compute-Runtime-Automation committed Oct 25, 2018
1 parent f5b55c5 commit a3ceaf8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions offline_compiler/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ using namespace OCLRT;

int main(int numArgs, const char *argv[]) {
try {
if (numArgs > 0 && !strcmp(argv[1], "disasm")) { // -file binary.bin -patch workspace/igc/inc -dump dump/folder
if (numArgs > 1 && !strcmp(argv[1], "disasm")) { // -file binary.bin -patch workspace/igc/inc -dump dump/folder
BinaryDecoder disasm;
int retVal = disasm.validateInput(numArgs, argv);
if (retVal == 0) {
return disasm.decode();
} else {
return retVal;
}
} else if (numArgs > 0 && !strcmp(argv[1], "asm")) { // -dump dump/folder -out new_elf.bin
} else if (numArgs > 1 && !strcmp(argv[1], "asm")) { // -dump dump/folder -out new_elf.bin
BinaryEncoder assembler;
int retVal = assembler.validateInput(numArgs, argv);
if (retVal == 0) {
Expand Down

0 comments on commit a3ceaf8

Please sign in to comment.