Merge branch 'calldata-yul' of https://github.com/hkalodner/slither into hkalodner-calldata-yul

pull/1085/head
Josselin 3 years ago
commit c0fbbeb1b8
  1. 8
      slither/solc_parsing/yul/parse_yul.py
  2. BIN
      tests/ast-parsing/compile/import-0.4.0-legacy.zip
  3. BIN
      tests/ast-parsing/compile/import-0.4.1-legacy.zip
  4. BIN
      tests/ast-parsing/compile/import-0.4.10-legacy.zip
  5. BIN
      tests/ast-parsing/compile/import-0.4.11-legacy.zip
  6. BIN
      tests/ast-parsing/compile/import-0.4.14-compact.zip
  7. BIN
      tests/ast-parsing/compile/import-0.4.14-legacy.zip
  8. BIN
      tests/ast-parsing/compile/import-0.4.16-compact.zip
  9. BIN
      tests/ast-parsing/compile/import-0.4.16-legacy.zip
  10. BIN
      tests/ast-parsing/compile/import-0.4.21-compact.zip
  11. BIN
      tests/ast-parsing/compile/import-0.4.21-legacy.zip
  12. BIN
      tests/ast-parsing/compile/import-0.4.22-compact.zip
  13. BIN
      tests/ast-parsing/compile/import-0.4.22-legacy.zip
  14. BIN
      tests/ast-parsing/compile/import-0.4.23-compact.zip
  15. BIN
      tests/ast-parsing/compile/import-0.4.23-legacy.zip
  16. BIN
      tests/ast-parsing/compile/import-0.4.24-compact.zip
  17. BIN
      tests/ast-parsing/compile/import-0.4.24-legacy.zip
  18. BIN
      tests/ast-parsing/compile/import-0.4.3-legacy.zip
  19. BIN
      tests/ast-parsing/compile/import-0.4.5-legacy.zip
  20. BIN
      tests/ast-parsing/compile/import-0.4.7-legacy.zip
  21. BIN
      tests/ast-parsing/compile/import-0.4.8-legacy.zip
  22. BIN
      tests/ast-parsing/compile/import-0.5.0-compact.zip
  23. BIN
      tests/ast-parsing/compile/import-0.5.0-legacy.zip
  24. BIN
      tests/ast-parsing/compile/import-0.5.14-compact.zip
  25. BIN
      tests/ast-parsing/compile/import-0.5.14-legacy.zip
  26. BIN
      tests/ast-parsing/compile/import-0.5.3-compact.zip
  27. BIN
      tests/ast-parsing/compile/import-0.5.3-legacy.zip
  28. BIN
      tests/ast-parsing/compile/import-0.5.4-compact.zip
  29. BIN
      tests/ast-parsing/compile/import-0.5.4-legacy.zip
  30. BIN
      tests/ast-parsing/compile/import-0.6.0-compact.zip
  31. BIN
      tests/ast-parsing/compile/import-0.6.0-legacy.zip
  32. BIN
      tests/ast-parsing/compile/import-0.6.1-compact.zip
  33. BIN
      tests/ast-parsing/compile/import-0.6.1-legacy.zip
  34. BIN
      tests/ast-parsing/compile/import-0.6.2-compact.zip
  35. BIN
      tests/ast-parsing/compile/import-0.6.2-legacy.zip
  36. BIN
      tests/ast-parsing/compile/import-0.6.5-compact.zip
  37. BIN
      tests/ast-parsing/compile/import-0.6.5-legacy.zip
  38. BIN
      tests/ast-parsing/compile/import-0.6.7-compact.zip
  39. BIN
      tests/ast-parsing/compile/import-0.6.7-legacy.zip
  40. BIN
      tests/ast-parsing/compile/import-0.6.8-compact.zip
  41. BIN
      tests/ast-parsing/compile/import-0.6.8-legacy.zip
  42. BIN
      tests/ast-parsing/compile/import-0.6.9-compact.zip
  43. BIN
      tests/ast-parsing/compile/import-0.6.9-legacy.zip
  44. BIN
      tests/ast-parsing/compile/import-0.7.0-compact.zip
  45. BIN
      tests/ast-parsing/compile/import-0.7.0-legacy.zip
  46. BIN
      tests/ast-parsing/compile/import-0.7.1-compact.zip
  47. BIN
      tests/ast-parsing/compile/import-0.7.1-legacy.zip
  48. BIN
      tests/ast-parsing/compile/import-0.7.4-compact.zip
  49. BIN
      tests/ast-parsing/compile/import-0.7.4-legacy.zip
  50. BIN
      tests/ast-parsing/compile/import-0.7.5-compact.zip
  51. BIN
      tests/ast-parsing/compile/import-0.7.5-legacy.zip
  52. BIN
      tests/ast-parsing/compile/import-0.8.0-compact.zip
  53. BIN
      tests/ast-parsing/compile/import-0.8.4-compact.zip
  54. BIN
      tests/ast-parsing/compile/import-0.8.6-compact.zip
  55. BIN
      tests/ast-parsing/compile/import-0.8.7-compact.zip
  56. 1
      tests/ast-parsing/expected/custom_error-0.4.0-legacy.json
  57. 1
      tests/ast-parsing/expected/custom_error-0.4.1-legacy.json
  58. 1
      tests/ast-parsing/expected/custom_error-0.4.10-legacy.json
  59. 1
      tests/ast-parsing/expected/custom_error-0.4.11-legacy.json
  60. 1
      tests/ast-parsing/expected/custom_error-0.4.14-compact.json
  61. 1
      tests/ast-parsing/expected/custom_error-0.4.14-legacy.json
  62. 1
      tests/ast-parsing/expected/custom_error-0.4.16-compact.json
  63. 1
      tests/ast-parsing/expected/custom_error-0.4.16-legacy.json
  64. 1
      tests/ast-parsing/expected/custom_error-0.4.21-compact.json
  65. 1
      tests/ast-parsing/expected/custom_error-0.4.21-legacy.json
  66. 1
      tests/ast-parsing/expected/custom_error-0.4.22-compact.json
  67. 1
      tests/ast-parsing/expected/custom_error-0.4.22-legacy.json
  68. 1
      tests/ast-parsing/expected/custom_error-0.4.23-compact.json
  69. 1
      tests/ast-parsing/expected/custom_error-0.4.23-legacy.json
  70. 1
      tests/ast-parsing/expected/custom_error-0.4.24-compact.json
  71. 1
      tests/ast-parsing/expected/custom_error-0.4.24-legacy.json
  72. 1
      tests/ast-parsing/expected/custom_error-0.4.3-legacy.json
  73. 1
      tests/ast-parsing/expected/custom_error-0.4.5-legacy.json
  74. 1
      tests/ast-parsing/expected/custom_error-0.4.7-legacy.json
  75. 1
      tests/ast-parsing/expected/custom_error-0.4.8-legacy.json
  76. 1
      tests/ast-parsing/expected/custom_error-0.5.0-compact.json
  77. 1
      tests/ast-parsing/expected/custom_error-0.5.0-legacy.json
  78. 1
      tests/ast-parsing/expected/custom_error-0.5.14-compact.json
  79. 1
      tests/ast-parsing/expected/custom_error-0.5.14-legacy.json
  80. 1
      tests/ast-parsing/expected/custom_error-0.5.3-compact.json
  81. 1
      tests/ast-parsing/expected/custom_error-0.5.3-legacy.json
  82. 1
      tests/ast-parsing/expected/custom_error-0.5.4-compact.json
  83. 1
      tests/ast-parsing/expected/custom_error-0.5.4-legacy.json
  84. 1
      tests/ast-parsing/expected/custom_error-0.6.0-compact.json
  85. 1
      tests/ast-parsing/expected/custom_error-0.6.0-legacy.json
  86. 1
      tests/ast-parsing/expected/custom_error-0.6.1-compact.json
  87. 1
      tests/ast-parsing/expected/custom_error-0.6.1-legacy.json
  88. 1
      tests/ast-parsing/expected/custom_error-0.6.2-compact.json
  89. 1
      tests/ast-parsing/expected/custom_error-0.6.2-legacy.json
  90. 1
      tests/ast-parsing/expected/custom_error-0.6.5-compact.json
  91. 1
      tests/ast-parsing/expected/custom_error-0.6.5-legacy.json
  92. 1
      tests/ast-parsing/expected/custom_error-0.6.7-compact.json
  93. 1
      tests/ast-parsing/expected/custom_error-0.6.7-legacy.json
  94. 1
      tests/ast-parsing/expected/custom_error-0.6.8-compact.json
  95. 1
      tests/ast-parsing/expected/custom_error-0.6.8-legacy.json
  96. 1
      tests/ast-parsing/expected/custom_error-0.6.9-compact.json
  97. 1
      tests/ast-parsing/expected/custom_error-0.6.9-legacy.json
  98. 1
      tests/ast-parsing/expected/custom_error-0.7.0-compact.json
  99. 1
      tests/ast-parsing/expected/custom_error-0.7.0-legacy.json
  100. 1
      tests/ast-parsing/expected/custom_error-0.7.1-compact.json
  101. Some files were not shown because too many files have changed in this diff Show More

@ -773,6 +773,14 @@ def parse_yul_identifier(root: YulScope, _node: YulNode, ast: Dict) -> Optional[
variable_found = _check_for_state_variable_name(root, potential_name) variable_found = _check_for_state_variable_name(root, potential_name)
if variable_found: if variable_found:
return variable_found return variable_found
var = root.function.get_local_variable_from_name(potential_name)
if var and var.location == "calldata":
return Identifier(var)
if name.endswith(".length"):
potential_name = name[:-7]
var = root.function.get_local_variable_from_name(potential_name)
if var and var.location == "calldata":
return Identifier(var)
raise SlitherException(f"unresolved reference to identifier {name}") raise SlitherException(f"unresolved reference to identifier {name}")

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save