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

uml does not work properly #106

Closed
johnzhu0907 opened this issue Jul 9, 2022 · 0 comments
Closed

uml does not work properly #106

johnzhu0907 opened this issue Jul 9, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@johnzhu0907
Copy link

Hi, there. I have found an issue about uml tool. The source contract is:

contract A is Base {
  using SafeMath for *;
  //...
}

When I click uml link, no diagram is rendered and there is an error in the output:
image
After searching the source code, I think maybe there is a bug in the following code snippet.

function getVariableDeclarationType(node) {
    if (typeof node.typeName != "undefined") {
        if (varDecIsArray(node)) {
            node = node.typeName.baseTypeName;
        } else {
            node = node.typeName;
        }
    }

    if (node.type == "ElementaryTypeName") {
        return node.name;
    } else if (node.type == "UserDefinedTypeName") {
        return node.namePath;
    } else if (node.type == "Mapping") {
        node.namePath = "mapping( " + getVariableDeclarationType(node.keyType) + "=>" + getVariableDeclarationType(node.valueType) + " )";
        return node.namePath;
    } else {
        return null;
    }
}

function getVariableDeclarationType(node) {
Can anyone have a look? Thanks.

@tintinweb tintinweb added the bug Something isn't working label Jul 21, 2022
tintinweb added a commit that referenced this issue Jul 21, 2022
uml: fix null-deref when parsing 'using-for *' - fixes #106
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants