Details
-
Task
-
Resolution: Unresolved
-
P2: Important
-
None
-
None
Description
It seems that the m_astComments member of Dom::QmlFile has some memory errors: segmentation faults, asan complains about stack-buffer-underflow but I could not really understand whats going wrong at the moment - probably a dangling reference somewhere.
Reproducer: once you have created a DomItem of a qml file with comments, try to print it out via `qDebug() << item.field(Fields::astComments)` or visit it with a visitor. It will crash when trying to print out the comment.
I used following qml file:
// Copyright (C) 2023 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 import QtQuick JSUsages { function f() { // sanity check: reuse variable names from function f in JSUsages. Those should not appear // as usages of the sum of JSUsages. let sum = 0; sum += 1; sum += helloProperty + 32 // valid usage of JSUsages's helloProperty return sum }}
Attachments
Issue Links
- is duplicated by
-
QTBUG-123645 CollectedComments data in AstComment is invalidated
-
- Reported
-
- relates to
-
QTBUG-119770 Add AST:Node-s representing .import, .pragma in .js files
-
- Reported
-