Skip to content

Commit 73a4afb

Browse files
yibo.niuyibo.niu
authored andcommitted
fix dangling arrayref by extending temporary object lifetime
1 parent f42c7e4 commit 73a4afb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/Conversion/TorchToTosa/TorchToTosa.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4019,7 +4019,7 @@ LogicalResult ConvertAtenOp<AtenIndexSelectOp>::matchAndRewrite(
40194019

40204020
auto index = adaptor.getIndex();
40214021
auto indexType = dyn_cast<RankedTensorType>(index.getType());
4022-
auto indexShape = indexType.getShape();
4022+
auto indexShape = SmallVector<int64_t>(indexType.getShape());
40234023

40244024
if (!indexType)
40254025
return rewriter.notifyMatchFailure(

0 commit comments

Comments
 (0)