llvm icon indicating copy to clipboard operation
llvm copied to clipboard

[Driver][SYCL] Fix crash with empty -fsycl-targets option

Open mdtoguchi opened this issue 1 year ago • 3 comments

When -fsycl-targets= -fsycl-targets=arg is passed on the command line, the empty -fsycl-targets= is processed and crashes due to the empty argument. Update the specific option parsing to use 'getLastArg' to avoid this situation. When the last arg has an empty argument, the driver will diagnose this situation and emit a friendly diagnostic.

mdtoguchi avatar Oct 18 '24 18:10 mdtoguchi

When the last arg has an empty argument, the driver will diagnose this situation and emit a friendly diagnostic.

I'm not able to see the corresponding code changes for this in the PR.

srividya-sundaram avatar Oct 18 '24 18:10 srividya-sundaram

When the last arg has an empty argument, the driver will diagnose this situation and emit a friendly diagnostic.

I'm not able to see the corresponding code changes for this in the PR.

There are no explicit changes that reflect this - it is existing behavior: > clang++ -fsycl -fsycl-targets= ~/a.cpp clang++: warning: joined argument expects additional value: '-fsycl-targets=' [-Wunused-command-line-argument]

mdtoguchi avatar Oct 18 '24 19:10 mdtoguchi

@intel/llvm-gatekeepers, this change looks ready to merge, please take a look. Thanks!

mdtoguchi avatar Oct 18 '24 22:10 mdtoguchi