From 2f004edff76fad8f4d2f238210cf6c07757e443b Mon Sep 17 00:00:00 2001 From: Svyatoslav Scherbina Date: Thu, 13 Oct 2016 16:48:48 +0300 Subject: [PATCH] Interop: fix minor bug in Indexer handle empty compiler args --- .../org/jetbrains/kotlin/native/interop/indexer/Indexer.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Interop/Indexer/src/main/kotlin/org/jetbrains/kotlin/native/interop/indexer/Indexer.kt b/Interop/Indexer/src/main/kotlin/org/jetbrains/kotlin/native/interop/indexer/Indexer.kt index a974f1b5c11..ab0ac552182 100644 --- a/Interop/Indexer/src/main/kotlin/org/jetbrains/kotlin/native/interop/indexer/Indexer.kt +++ b/Interop/Indexer/src/main/kotlin/org/jetbrains/kotlin/native/interop/indexer/Indexer.kt @@ -279,8 +279,10 @@ fun buildNativeIndexImpl(headerFile: File, args: List): NativeIndex { indexEntityReference.setStatic(null) } + val commandLineArgs = if (args1.size != 0) mallocNativeArrayOf(Int8Box.Companion, *args1)[0] else null + clang_indexSourceFile(indexAction, clientData, callbacks, IndexerCallbacks.size, 0, headerFile.path, - mallocNativeArrayOf(Int8Box.Companion, *args1)[0], args1.size, null, 0, null, 0) + commandLineArgs, args1.size, null, 0, null, 0) return res