Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
d1948a26
Unverified
Commit
d1948a26
authored
Apr 19, 2018
by
yann300
Committed by
GitHub
Apr 19, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #763 from leonardoalt/fix_analysis_constructor
Fix 'potentially should be const' for constructors in static analysis
parents
fa411bb4
d54c3960
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
1 deletion
+13
-1
constantFunctions.js
remix-solidity/src/analysis/modules/constantFunctions.js
+1
-1
staticAnalysisCommon.js
remix-solidity/src/analysis/modules/staticAnalysisCommon.js
+12
-0
No files found.
remix-solidity/src/analysis/modules/constantFunctions.js
View file @
d1948a26
...
@@ -34,7 +34,7 @@ function report (contracts, multipleContractsWithSameName) {
...
@@ -34,7 +34,7 @@ function report (contracts, multipleContractsWithSameName) {
contracts
.
forEach
((
contract
)
=>
{
contracts
.
forEach
((
contract
)
=>
{
contract
.
functions
.
forEach
((
func
)
=>
{
contract
.
functions
.
forEach
((
func
)
=>
{
if
(
common
.
isPayableFunction
(
func
.
node
))
{
if
(
common
.
isPayableFunction
(
func
.
node
)
||
common
.
isConstructor
(
func
.
node
)
)
{
func
.
potentiallyshouldBeConst
=
false
func
.
potentiallyshouldBeConst
=
false
}
else
{
}
else
{
func
.
potentiallyshouldBeConst
=
checkIfShouldBeConstant
(
common
.
getFullQuallyfiedFuncDefinitionIdent
(
contract
.
node
,
func
.
node
,
func
.
parameters
),
func
.
potentiallyshouldBeConst
=
checkIfShouldBeConstant
(
common
.
getFullQuallyfiedFuncDefinitionIdent
(
contract
.
node
,
func
.
node
,
func
.
parameters
),
...
...
remix-solidity/src/analysis/modules/staticAnalysisCommon.js
View file @
d1948a26
...
@@ -521,6 +521,17 @@ function isPayableFunction (node) {
...
@@ -521,6 +521,17 @@ function isPayableFunction (node) {
}
}
/**
/**
* True if is constructor
* @node {ASTNode} some AstNode
* @return {bool}
*/
function
isConstructor
(
node
)
{
return
isFunctionDefinition
(
node
)
&&
(
node
.
attributes
.
isConstructor
===
true
)
}
/**
* True if unary increment operation
* True if unary increment operation
* @node {ASTNode} some AstNode
* @node {ASTNode} some AstNode
* @return {bool}
* @return {bool}
...
@@ -857,6 +868,7 @@ module.exports = {
...
@@ -857,6 +868,7 @@ module.exports = {
isContractDefinition
:
isContractDefinition
,
isContractDefinition
:
isContractDefinition
,
isConstantFunction
:
isConstantFunction
,
isConstantFunction
:
isConstantFunction
,
isPayableFunction
:
isPayableFunction
,
isPayableFunction
:
isPayableFunction
,
isConstructor
:
isConstructor
,
isInlineAssembly
:
isInlineAssembly
,
isInlineAssembly
:
isInlineAssembly
,
isNewExpression
:
isNewExpression
,
isNewExpression
:
isNewExpression
,
isReturn
:
isReturn
,
isReturn
:
isReturn
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment