-
Notifications
You must be signed in to change notification settings - Fork 0
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
Step 9 - Write your own class #9
Comments
The
|
⌨️ Activity: Write your own
|
Congratulations, looks like the query you introduced in 97faa7a finds the correct results! If you created a pull request, merge it. Let's continue to the next step. |
Step 9: Write your own class
In this step we will learn how to write our own CodeQL classes. This will help us make the logic of our query more readable, easier to reuse, and easier to refine.
We'd like to find the same results as in the previous step, i.e. the top level expressions that correspond to the
ntohl
,ntohs
andntohll
macro invocations. It would be useful if we could refer to all such expressions directly, just like we can useMacroInvocation
from the standard library to refer to all macro invocations.We will define a class to describe exactly this set of expressions, and use it in the last step of this course.
The
Expr
class is the set of all expressions, and we are interested in a more specific set of expressions, so the class we write will be a subclass ofExpr
.The text was updated successfully, but these errors were encountered: