File tree 1 file changed +6
-4
lines changed
1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -1108,17 +1108,19 @@ SLANG_NO_THROW SlangResult SLANG_MCALL Session::parseCommandLineArguments(
1108
1108
if (outDesc->structureSize < sizeof (slang::SessionDesc))
1109
1109
return SLANG_E_BUFFER_TOO_SMALL;
1110
1110
RefPtr<ParsedCommandLineData> outData = new ParsedCommandLineData ();
1111
- SerializedOptionsData optionData;
1112
1111
RefPtr<EndToEndCompileRequest> tempReq = new EndToEndCompileRequest (this );
1113
1112
tempReq->processCommandLineArguments (argv, argc);
1113
+ outData->options .setCount (1 + tempReq->getLinkage ()->targets .getCount ());
1114
+ int optionDataIndex = 0 ;
1115
+ SerializedOptionsData& optionData = outData->options [optionDataIndex];
1116
+ optionDataIndex++;
1114
1117
tempReq->getOptionSet ().serialize (&optionData);
1115
- outData->options .add (optionData);
1116
1118
for (auto target : tempReq->getLinkage ()->targets )
1117
1119
{
1118
1120
slang::TargetDesc tdesc;
1119
- SerializedOptionsData targetOptionData;
1121
+ SerializedOptionsData& targetOptionData = outData->options [optionDataIndex];
1122
+ optionDataIndex++;
1120
1123
tempReq->getTargetOptionSet (target).serialize (&targetOptionData);
1121
- outData->options .add (targetOptionData);
1122
1124
tdesc.compilerOptionEntryCount = (uint32_t )targetOptionData.entries .getCount ();
1123
1125
tdesc.compilerOptionEntries = targetOptionData.entries .getBuffer ();
1124
1126
outData->targets .add (tdesc);
You can’t perform that action at this time.
0 commit comments