From 5bff6c4e787851417ae8b8765dd673979088b7ac Mon Sep 17 00:00:00 2001 From: Konrad Weiss Date: Mon, 11 Sep 2023 19:21:26 +0200 Subject: [PATCH] Spotless --- .../aisec/cpg/frontends/llvm/ExpressionHandler.kt | 8 ++++---- .../cpg/frontends/llvm/LLVMIRLanguageFrontendTest.kt | 12 ++++-------- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/cpg-language-llvm/src/main/kotlin/de/fraunhofer/aisec/cpg/frontends/llvm/ExpressionHandler.kt b/cpg-language-llvm/src/main/kotlin/de/fraunhofer/aisec/cpg/frontends/llvm/ExpressionHandler.kt index 6efb11d16e..a6a6e72817 100644 --- a/cpg-language-llvm/src/main/kotlin/de/fraunhofer/aisec/cpg/frontends/llvm/ExpressionHandler.kt +++ b/cpg-language-llvm/src/main/kotlin/de/fraunhofer/aisec/cpg/frontends/llvm/ExpressionHandler.kt @@ -398,10 +398,10 @@ class ExpressionHandler(lang: LLVMIRLanguageFrontend) : * [`extractvalue`](https://llvm.org/docs/LangRef.html#extractvalue-instruction) instruction * which works in a similar way. * - * We try to convert it either into an [SubscriptExpression] or an [MemberExpression], - * depending on whether the accessed variable is a struct or an array. Furthermore, since - * `getelementptr` allows an (infinite) chain of sub-element access within a single instruction, - * we need to unwrap those into individual expressions. + * We try to convert it either into an [SubscriptExpression] or an [MemberExpression], depending + * on whether the accessed variable is a struct or an array. Furthermore, since `getelementptr` + * allows an (infinite) chain of sub-element access within a single instruction, we need to + * unwrap those into individual expressions. */ internal fun handleGetElementPtr(instr: LLVMValueRef): Expression { val isGetElementPtr = diff --git a/cpg-language-llvm/src/test/kotlin/de/fraunhofer/aisec/cpg/frontends/llvm/LLVMIRLanguageFrontendTest.kt b/cpg-language-llvm/src/test/kotlin/de/fraunhofer/aisec/cpg/frontends/llvm/LLVMIRLanguageFrontendTest.kt index 65b9d43802..1c1f7ce344 100644 --- a/cpg-language-llvm/src/test/kotlin/de/fraunhofer/aisec/cpg/frontends/llvm/LLVMIRLanguageFrontendTest.kt +++ b/cpg-language-llvm/src/test/kotlin/de/fraunhofer/aisec/cpg/frontends/llvm/LLVMIRLanguageFrontendTest.kt @@ -858,8 +858,7 @@ class LLVMIRLanguageFrontendTest { assertEquals(1, yMod.rhs.size) assertEquals( 3L, - ((yMod.lhs.first() as? SubscriptExpression)?.subscriptExpression as? Literal<*>) - ?.value + ((yMod.lhs.first() as? SubscriptExpression)?.subscriptExpression as? Literal<*>)?.value ) assertSame( yModInit, @@ -875,20 +874,17 @@ class LLVMIRLanguageFrontendTest { assertNotNull(shuffledInit) assertSame( origX, - ((shuffledInit.initializers[0] as? SubscriptExpression)?.arrayExpression - as? Reference) + ((shuffledInit.initializers[0] as? SubscriptExpression)?.arrayExpression as? Reference) ?.refersTo ) assertSame( yModInit, - ((shuffledInit.initializers[1] as? SubscriptExpression)?.arrayExpression - as? Reference) + ((shuffledInit.initializers[1] as? SubscriptExpression)?.arrayExpression as? Reference) ?.refersTo ) assertSame( yModInit, - ((shuffledInit.initializers[2] as? SubscriptExpression)?.arrayExpression - as? Reference) + ((shuffledInit.initializers[2] as? SubscriptExpression)?.arrayExpression as? Reference) ?.refersTo ) assertSame(