Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
QueryR
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Julien Lopez
QueryR
Commits
0ca10ed7
Commit
0ca10ed7
authored
7 years ago
by
stepan
Browse files
Options
Downloads
Patches
Plain Diff
Make sure TAG RFFI function always return RSymbol or RNull
parent
2f1ca723
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
com.oracle.truffle.r.ffi.impl/src/com/oracle/truffle/r/ffi/impl/nodes/AttributesAccessNodes.java
+6
-3
6 additions, 3 deletions
...racle/truffle/r/ffi/impl/nodes/AttributesAccessNodes.java
with
6 additions
and
3 deletions
com.oracle.truffle.r.ffi.impl/src/com/oracle/truffle/r/ffi/impl/nodes/AttributesAccessNodes.java
+
6
−
3
View file @
0ca10ed7
...
...
@@ -48,6 +48,7 @@ import com.oracle.truffle.r.runtime.RRuntime;
import
com.oracle.truffle.r.runtime.data.RArgsValuesAndNames
;
import
com.oracle.truffle.r.runtime.data.RAttributable
;
import
com.oracle.truffle.r.runtime.data.RAttributeStorage
;
import
com.oracle.truffle.r.runtime.data.RDataFactory
;
import
com.oracle.truffle.r.runtime.data.RExternalPtr
;
import
com.oracle.truffle.r.runtime.data.RList
;
import
com.oracle.truffle.r.runtime.data.RNull
;
...
...
@@ -116,14 +117,16 @@ public final class AttributesAccessNodes {
@Specialization
public
Object
doPairlist
(
RPairList
obj
)
{
return
obj
.
getTag
();
Object
result
=
obj
.
getTag
();
assert
result
instanceof
RSymbol
||
result
==
RNull
.
instance
;
return
result
;
}
@Specialization
public
Object
doArgs
(
RArgsValuesAndNames
obj
)
{
ArgumentsSignature
signature
=
obj
.
getSignature
();
if
(
signature
.
getLength
()
>
0
&&
signature
.
getName
(
0
)
!=
null
)
{
return
signature
.
getName
(
0
);
return
RDataFactory
.
createSymbol
(
signature
.
getName
(
0
)
)
;
}
return
RNull
.
instance
;
}
...
...
@@ -138,7 +141,7 @@ public final class AttributesAccessNodes {
@Cached
(
"create()"
)
GetNamesAttributeNode
getNamesAttributeNode
)
{
RStringVector
names
=
getNamesAttributeNode
.
getNames
(
obj
);
if
(
names
!=
null
&&
names
.
getLength
()
>
0
)
{
return
names
.
getDataAt
(
0
);
return
RDataFactory
.
createSymbol
(
names
.
getDataAt
(
0
)
)
;
}
return
RNull
.
instance
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment