File tree Expand file tree Collapse file tree 2 files changed +8
-7
lines changed
joern-cli/frontends/rubysrc2cpg/src
main/scala/io/joern/rubysrc2cpg/astcreation
test/scala/io/joern/rubysrc2cpg/querying Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -185,9 +185,7 @@ trait AstForExpressionsCreator(implicit withSchemaValidation: ValidationMode) {
185185 protected def astForMemberCall (node : RubyCallWithBase , isStatic : Boolean = false ): Ast = {
186186
187187 def createMemberCall (n : RubyCallWithBase ): Ast = {
188- val isErbCall = n.methodName == Constants .joernErbBufferAppend && n.arguments.headOption.exists(
189- _.span.text == " self.joern__buffer"
190- )
188+ val isErbCall = n.methodName == Constants .joernErbBufferAppend
191189
192190 val (nodeOp, hasStringArguments, receiverAst) = if (isErbCall) {
193191 val hasStringArgs = n.arguments.tail.exists {
@@ -325,7 +323,11 @@ trait AstForExpressionsCreator(implicit withSchemaValidation: ValidationMode) {
325323 scope.tryResolveTypeReference(x.typeName).map(_.name).getOrElse(Defines .Any )
326324 }
327325 .orElse(Option (Defines .Any ))
328- val typeFullName = if node.memberName == " joern__buffer" then Constants .stringPrefix else Defines .Any
326+ val typeFullName = if (node.memberName == " joern__buffer" || node.memberName == " joern__inner_buffer" ) {
327+ Constants .stringPrefix
328+ } else {
329+ Defines .Any
330+ }
329331 val fieldAccess = callNode(
330332 node,
331333 code,
Original file line number Diff line number Diff line change @@ -261,9 +261,8 @@ class ErbTests extends RubyCode2CpgFixture {
261261 inside(lambdaMethod.body.astChildren.l) {
262262 case _ :: _ :: (appendCallTemplate : Call ) :: _ :: _ :: Nil =>
263263 appendCallTemplate.code shouldBe " self.joern__buffer_append(joern__inner_buffer, <%= form.text_field :name %>)"
264- val List (selfId, appendCallArgOne, appendCallArgTwo : Call ) = appendCallTemplate.argument.l: @ unchecked
265- selfId.code shouldBe " self"
266-
264+ appendCallTemplate.methodFullName shouldBe " <operator>.joernBufferAppend"
265+ val List (appendCallArgOne, appendCallArgTwo : Call ) = appendCallTemplate.argument.l: @ unchecked
267266 appendCallArgOne.code shouldBe " joern__inner_buffer"
268267 appendCallArgTwo.code shouldBe " <%= form.text_field :name %>"
269268 appendCallArgTwo.methodFullName shouldBe RubyOperators .templateOutEscape
You can’t perform that action at this time.
0 commit comments