Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[c2cpg] Improvements for range-based for-statement and local code fields #5215

Merged
merged 1 commit into from
Jan 9, 2025

Conversation

max-leuthaeuser
Copy link
Contributor

  • range-based for-statement blocks had multiple outgoing CFG edges because the children were not wrapped into blocks.
  • code fields for locals from NamedTypeSpecifiers now preserve static and const modifier

- range-based for-statement blocks had multiple outgoing CFG edges because the children were not wrapped into blocks.
- code fields for locals from NamedTypeSpecifiers now preserve static and const modifier
@max-leuthaeuser max-leuthaeuser requested a review from maltek January 9, 2025 15:38
@@ -142,14 +142,16 @@ trait AstCreatorHelper(implicit withSchemaValidation: ValidationMode) { this: As
"class"
)

private val KeepTypeKeywords: List[String] = List("unsigned", "volatile")
private val KeepTypeKeywords: List[String] = List("unsigned", "volatile", "const", "static")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rename this, since static is decidedly not part of the type. (I think it's called a storage modifier.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, it's a list of keywords to keep at the string representation of a type. I keep it that way for now.

@max-leuthaeuser max-leuthaeuser merged commit 97806c7 into master Jan 9, 2025
5 checks passed
@max-leuthaeuser max-leuthaeuser deleted the max/c2cpgImprovements branch January 9, 2025 20:18
@max-leuthaeuser max-leuthaeuser restored the max/c2cpgImprovements branch January 10, 2025 09:50
@max-leuthaeuser max-leuthaeuser deleted the max/c2cpgImprovements branch January 10, 2025 09:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants