Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
clangml-transforms
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
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
Admin message
GitLab upgrade completed. Current version is 17.11.3.
Show more breadcrumbs
memcad
clangml-transforms
Commits
e6889aa3
Commit
e6889aa3
authored
2 years ago
by
Thierry Martinez
Browse files
Options
Downloads
Patches
Plain Diff
Fix conversion to pointer arithmetic
parent
feb58d03
No related branches found
No related tags found
No related merge requests found
Pipeline
#742145
failed
2 years ago
Stage: snapshot
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
clangml-transforms/for_memcad.ml
+12
-5
12 additions, 5 deletions
clangml-transforms/for_memcad.ml
with
12 additions
and
5 deletions
clangml-transforms/for_memcad.ml
+
12
−
5
View file @
e6889aa3
...
...
@@ -596,10 +596,17 @@ with type 'a Applicative.t = 'a Applicative.t = struct
{
record_decl
with
fields
=
name_anonymous_fields
record_decl
.
fields
}
,
Free_monoid
.
zero
let
is_pointer_type
(
ty
:
Clang
.
Type
.
t
)
=
match
ty
.
desc
with
|
Pointer
_
->
true
|
_
->
false
let
is_array
(
expr
:
Clang
.
Expr
.
t
)
=
let
cursor
=
Clang
.
Ast
.
cursor_of_node
expr
in
match
Clang
.
ext_get_cursor_kind
cursor
with
|
ImplicitCastExpr
->
let
child
=
Option
.
get
(
Clang
.
first_child
cursor
)
in
begin
match
Clang
.
get_type_kind
(
Clang
.
get_cursor_type
child
)
with
|
ConstantArray
->
true
|
_
->
false
end
|
_
->
false
let
hook
:
type
a
.
a
Refl
.
refl
->
(
a
->
env
->
a
*
accu
)
->
(
a
->
env
->
a
*
accu
)
=
...
...
@@ -632,7 +639,7 @@ with type 'a Applicative.t = 'a Applicative.t = struct
|
UnaryExpr
{
kind
=
SizeOf
;
argument
}
->
visit_unary_expr_size_of
argument
env
|
ArraySubscript
{
base
;
index
}
when
is_pointer_type
(
Clang
.
Type
.
of_node
base
)
->
when
not
(
is_array
base
)
->
let
x'
:
Clang
.
Ast
.
expr_desc
=
UnaryOperator
{
kind
=
Deref
;
operand
=
{
base
with
desc
=
BinaryOperator
{
...
...
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